Git, GitHub, and R


GitHub is a site for sharing and collaborating on code, and for careful tracking of changes as you progress. As of right now, it is the best way to organize your work in R, to showcase it to employers, or to share it with collaborators.

Using Git and GitHub takes some getting used to, and can be frustrating at times even to experts. We will use it only in the most basic form in this course.


Time Estimates:
     Videos: 45 min
     Readings: 10 min
     Activities: 30 min
     Check-ins: 4



Extra Resources:

Introduction to Git and GitHub


Required Video: Intro to Git and Github




Check-In 1: Make a GitHub Account


Create an account on GitHub.com, if you have not already.

Ideally, your username will be related to your real name, e.g. “kbodwin” rather than “SuperKrazy2000”. However, this is not required; choose whatever username you prefer.


Check-In 2: Make a repository


Create a private repository called “Test Repo”.

Create a new text file called “My favorite”. Copy-paste your favorite quote or poem into the file.

Take a screenshot of your repository. It should look similar to 9:43 of the video.


Branches and Pull Requests


Required Video: Branching




Check-In 3: Make a branch and pull request


Create a new branch of your “Test Repo” repository.
Name this branch after your favorite animal.

In this branch, replace a word in your text file with the animal’s name.

Create a Pull Request to your master branch from your new branch.

Take a screen shot of your completed pull request. It should look like 8:14 of the video.


Git and RStudio


Required Video: GitHub and RStudio




Check-In 4: Access GitHub from RStudio


Follow the instructions in the video to make a new R Project that is also a GitHub Repository.

Take a screenshot showing yourself committing to a new branch. It should look like 8:26 of the video.

Note: There are a lot of fiddly computer details that might prevent this from going as smoothly as in the video. This doesn’t necessarily mean you are doing something wrong! If you hit a snag, please contact Dr. B. to get help.


Renaming the master branch


Required Reading: Renaming the master branch


There is no Check-In for this reading; I ask only that you read the blog post and think carefully about the issues. Please do not skip this section.

If you do feel that you wish to rename your master branch, I am happy to help you through the process.