Introduction


Figure 1

An XKCD comic about the git control system.

Figure 2

A diagram showing the relationship between the working directory, staging area, and repository in git.
Staging Area

Figure 3

A diagram showing the components that make up a git commit.
What is in a Commit

Figure 4

Review 2
Review 2

Branches


Figure 1

A diagram showing branching in a theoretical git repository.
Git Branching

Figure 2

A diagram showing several commits on a single branch in a theoretical git repository.
Git Branching

Figure 3

Git Branching
Git Branching

Remote Repositories


Figure 1

A diagram showing a local git repository with remote connections to two other repositories.
Remote Schematic

Undoing Changes


Figure 1

A diagram showing a repository before and after reverting the last commit.
git revert

Figure 2

A diagram showing a repository before and after resetting the last commit.
git reset

Figure 3

A diagram showing a repository before and after using git checkout to move to a previous commit.
git checkout

Merging


Figure 1

A diagram showing different types of Git merges.
Merging diagram.

Figure 2

comment: <> (Merging 2comment: <> (Merging FF) comment: <> (Merging no FF) comment: <> (Merging 3 Way)


Tags


Branching Models


Forking Workflow


Figure 1

GitFlow 1
GitFlow 1

Figure 2

GitFlow 1{Alt: A brief refresher from Git Training: The figure shows the local computer (“You”) with branch1 that includes three files of which one is indicated as removed. An arrow from the local computer points to the cloud in which origin and upstream are located, with a picture of GitHubs Octocat. The arrow from local points to origin with you/code(branch1), also with three files of which the same is indicated as removed. Origin has an arrow pointing to upstream with “PR” written on top of it and a screenshot of the “merge pull request” button from the GitHub webinterface. Upstream has spacetelescope/code (main) with the same three files of which the same file is indicated as removed as in local and origin.}


Figure 3

GitFlow 1{Alt: …}


Figure 4

GitFlow 1
GitFlow 1

Data Science Workflow


Figure 1

GitFlow 1GitFlow 1GitFlow 1GitFlow 1GitFlow 1 :::::::::::::::::::::::::::::::::::::::: keypoints


Large Files


Undo, Move, Cherrypick


Figure 1

GitFlow 1GitFlow 1GitFlow 1


Rebase, Squash, Bisect, Patch


Figure 1

GitFlow 1GitFlow 1GitFlow 1GitFlow 1


Hooks and Actions


Figure 1

GitFlow 1
GitFlow 1

Setting up the Command Prompt


Additional Resources


Figure 1

ExternalGITKGitHub