Some general resources

Happy Git and GitHub for the useR

Create a GitHub account for education using your UChicago email address. This may involve sending a picture of your student ID or verifying your student status in some other way. Getting approval might take a few minutes or a few days, so do this ASAP!

Install

General install guide

Note: The first troubleshooting step for any issues with Terminal should be to start a new session (i.e., fully quit and reopen Terminal).

Connect

Connecting RStudio & GitHub Guide

  1. Create and store a personal access token for HTTPS (recommended, very easy) or keys for SSH.

  2. Again, many options for how to do this. If you don’t already have a preference, I recommend following the directions in section 9.1 TL;DR. Those simple steps should be enough to get everything working and let you skip any additional steps in the terminal.

  3. Create a repo on GitHub:

  4. Clone the repo (from GitHub) as a new project in R studio. This will result in a new project containing 3 files: the .Rproj file, the .gitignore, and README.md.

  1. Confirm that you can pull from GitHub to R Studio:
  2. Edit the readme file on the GitHub website. Add some new text or make any other obvious change.
  3. Commit the changes with an informative commit message.
  4. In R studio, open the Git tab and click pull. You should see a brief message describing the changes. Open the readme file in R studio and confirm the changes appear.
  5. Confirm that you can push to GitHub from R Studio:
  6. Edit the readme file in the R Studio editor. Again, add some text or make any other obvious change and then save the file.
  7. To commit the changes, click “Commit” in the Git tab to open the “Review Changes” window. Select the files you have added, deleted, or edited (in this case just README.md). You should now see a message in the Review Changes window that says “Your branch is ahead of ‘origin/main’ by 1 commit.”
  8. Click “Push” to push your committed changes to GitHub.
  9. Check that the changes are reflected in the readme file on GitHub.

Configure

  1. On GitHub:
  2. Invite collaborators (e.g., your instructor, PI, coding team), and assign appropriate permissions, even if your repo is public. Anyone can see the contents of a public repo, but you must invite (or approve) collaborators to commit changes.
  3. Review the other settings. It’s unlikely you’ll need to change anything at this point, but you should get a sense of what the options are.
  4. You may want to make changes to your repo/R project, like adding exclusions to the .gitignore, creating some folders to pre-organize, uploading data, or adding information to the readme. You can make changes like this either locally (through R Studio and/or Finder/File Explorer) or remotely (through GitHub). Be sure to commit and push all changes!
  5. When you commit a change in R Studio, you might get a message about configuring your committer identity. Follow the prompted instructions to do so. By default, you’ll be editing in Terminal using VI. If that’s new to you, refer to this.