Version Control with Git

Extract All Images

Automated Version Control

Automated Version Control-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"

Automated Version Control-2

A diagram demonstrating how a single document grows as the result of sequential changes

Automated Version Control-3

A diagram with one source document that has been modified in two different ways to produce two different versions of the document

Automated Version Control-4

A diagram that shows the merging of two different document versions into one document that contains all of the changes from both versions

Terminology-1

Terminology-2

Setting Up Git

This episode contains no images.

Creating a Repository

This episode contains no images.

Branches

Branches-1

A Git graph showing the root-commit on the main branch and a new forecast branch with one commit branched off the root-commit. This branch is then merged back into main via a merge commit on GitHub. mainforecast

Creating Branches-1

A Git graph showing one commit, the root-commit on the main branch. main6f12a47

Creating Branches-2

A Git graph showing the root-commit on the main branch and a new forecast branch with no commits. mainforecast6f12a47

Tracking Changes

Tracking Changes-1

A Git graph showing the root-commit on the main branch and a new forecast branch, branching off the root-commit, with one commit. mainforecastInitial commitCreate a md file with the forecast

Tracking Changes-2

A diagram showing how "git add" registers changes in the staging area, while "git commit" moves changes from the staging area to the repository

Tracking Changes-3

A Git graph showing the root-commit on the main branch and a new forecast branch, branching off the root-commit, with two commits. mainforecastInitial commitCreate a md file with the forecastAdd tomorrows forecast to forecast.md

Tracking Changes-4

A Git graph showing the root-commit on the main branch and a new forecast branch, branching off the root-commit, with three commits. mainforecastInitial commitCreate a md file with the forecastAdd tomorrows forecast to forecast.mdModify the forecast to add a chance of Sun

Tracking Changes-5

A diagram showing two documents being separately staged using git add, before being combined into one commit using git commit

Exploring History

This episode contains no images.

Reverting Changes

Restoring a file from further back-1

A diagram showing how git restore can be used to restore the previous version of two files

Ignoring Things

This episode contains no images.

Break

Summary-1

A Git graph showing the root-commit on the main branch and a new forecast branch with five commits. mainforecast

Remotes in GitHub

1. Create a remote repository-1

The first step in creating a repository on GitHub: clicking the "create new" button

1. Create a remote repository-2

The second step in creating a repository on GitHub: filling out the new repository form to provide the repository name, and specify that neither a readme nor a license should be created

1. Create a remote repository-3

The summary page displayed by GitHub after a new repository has been created. It contains instructions for configuring the new GitHub repository as a Git remote

1. Create a remote repository-4

A diagram showing how "git add" registers changes in the staging area, while "git commit" moves changes from the staging area to the repository

1. Create a remote repository-5

A diagram illustrating how the GitHub "weather" repository is also a Git repository like our local repository, but that it is currently empty

2. Connect local to remote repository-1

A screenshot showing that clicking on "SSH" will make GitHub provide the SSH URL for a repository instead of the HTTPS URL

4. Push local changes to a remote-1

A diagram showing how "git push origin" will push changes from the local repository to the remote, making the remote repository an exact copy of the local repository.

Exploring GitHub

Exploring GitHub-1

The GitHub home page showing repositories on the left, and news in the centre.

Exploring GitHub-2

A screenshot of the GitHub repository for the git-novice lesson.

Exploring GitHub-3

The GitHub nav at the top of a repository.

Exploring GitHub-4

The GitHub navigation tabs for a repository.

Exploring GitHub-5

A screenshot of the lower section of the repository interface.

Exploring History on GitHub

Viewing the History of a Repository on GitHub-1

A screenshot of the main branch of weather repository on GitHub.

Viewing the History of a Repository on GitHub-2

A screenshot of the main branch of weather repository on GitHub, showing the branch drop down box.

Viewing the History of a Repository on GitHub-3

A screenshot of the forecast branch of weather repository on GitHub, showing how to navigate to the commits.

Viewing the History of a Repository on GitHub-4

A screenshot of the commit on the forecast branch of the weather repository on GitHub.

Viewing Differences Between Commits-1

A screenshot of the compare page for the weather repository on GitHub.

Viewing Differences Between Commits-2

A screenshot showing the differences between two Git commit SHAs from the weather repository on GitHub.

Pull Requests

Creating a Pull Request-1

A screenshot of the weather repo showing the notification prompting us to Compare & pull request for the forecast branch.

Creating a Pull Request-2

A screenshot of the weather repo showing the creation of a pull request for the forecast branch changes.

Creating a Pull Request-3

A screenshot showing the dropdown to swap from a normal pull request to a creating a draft pull request.

Creating a Pull Request-4

A screenshot showing an open pull request on the weather repo.

Rulesets-1

A screenshot showing the creation of a rule to protect the main branch in the repository settings, rulesets page.

Merging a Pull Request-1

A screenshot showing the dropdown to swap from a normal merge to a squash merge.

Merging a Pull Request-2

A screenshot showing a closed pull request on the weather repository.

Configuring GitHub

Profile Settings-1

A screenshot of a users GitHub profile.

Configuring Notifications-1

A screenshot of the GitHub weather repo with the Unwatch dropdown expanded.

Organisation Membership-1

A screenshot of the GitHub organisation People settings for an organisation showing how to change your organisation visibility.

End

Summary-1

A sequence diagram showing the workflow we used during the lesson.

Open Science

This episode contains no images.

Licensing

This episode contains no images.

Citation

This episode contains no images.

Hosting

This episode contains no images.

‘Using Git from RStudio’

‘Using Git from RStudio’-1

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

‘Using Git from RStudio’-2

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

‘Using Git from RStudio’-3

RStudio window showing the "Create Project From Existing Directory" dialog. In the dialog, the project working directory has been set to "~/Desktop/weather"

‘Using Git from RStudio’-4

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

‘Using Git from RStudio’-5

RStudio window demonstrating the use of the editor panel to modify the "pluto.txt" file

‘Using Git from RStudio’-6

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

‘Using Git from RStudio’-7

RStudio screenshow showing the "Review Changes" dialog. The top left panel shows the list of files that can be included or excluded from the commit. The top right panel is for writing a commit message. The bottom panel shows information about the currently selected file in the top left panel.

‘Using Git from RStudio’-8

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

‘Using Git from RStudio’-9

RStudio screenshot showing the "Review Changes" dialog after pressing the "History" button. The top panel lists the commits in the repository, similar to git log. The bottom panel shows the changes included in the commit that has been selected in the top panel.

‘Using Git from RStudio’-10

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