Automated Version Control


Figure 1

Comic: a PhD student sends "FINAL.doc" to their supervisor, but after several increasingly intense and frustrating rounds of comments and revisions they end up with a file named "FINAL_rev.22.comments49.corrections.10.#@$%WHYDIDCOMETOGRADSCHOOL????.doc"
“notFinal.doc” by Jorge Cham, https://www.phdcomics.com

Figure 2

Changes Are Saved Sequentially

Figure 3

Different Versions Can be Saved

Figure 4

Multiple Versions Can be Merged

Setting Up Git


Creating a Repository


Figure 1

motivatingexampleWerewolf vs dracula by b-maze / Deviant Art. Mars by European Space Agency / CC-BY-SA 3.0 IGO. Pluto / Courtesy NASA/JPL-Caltech. Mummy © Gilad Fried / The Noun Project / CC BY 3.0. Moon © Luc Viatour / https://lucnix.be / CC BY-SA 3.0.


Tracking Changes


Figure 1

The Git Staging Area

Figure 2

The Git Commit Workflow

Exploring History


Figure 1

Git Checkout

Figure 2

https://figshare.com/articles/How_Git_works_a_cartoon/1328266

Ignoring Things


Remotes in GitLab


Figure 1

Creating a Project on GitLab (Step 1)

Figure 2

Creating a Project on GitLab (Step 2)

Figure 3

Creating a Project on Gitlab (Step 3)

Figure 4

The Local Repository with Git Staging Area

Figure 5

Freshly-Made GitLab Repository

Figure 6

Where to Find Repository URL on GitLab

Figure 7

GitLab Repository After First Push

Collaborating


Figure 1

screenshot of repository page with Manage then Members selected, showing how to add Collaborators in a GitLab project

Figure 2

After Creating Clone of Repository

Conflicts


Figure 1

The Conflicting Changes

Open Science


Licensing


Citation


Hosting


Supplemental: Using Git from RStudio


Figure 1

RStudio screenshot showing the file menu dropdown with "New Project..." selected

Figure 2

RStudio screenshot showing New Project dialog window with "Create project from existing directory" selected

Figure 3


Figure 4

RStudio window after new project is created with large arrow pointing to vertical Git menu bar.

Figure 5


Figure 6

RStudio screenshot showing the Git menu dropdown with "Commit..." selected

Figure 7


Figure 8

RStudio screenshot showing the git menu dropdown with "History" selected

Figure 9


Figure 10

RStudio screenshot showing .gitignore open in the editor pane with the files .Rproj.user, .Rhistory, .RData, and *.Rproj added to the end