1 Outline

We will learn about version control using git and GitHub. git will track and verison your files, GitHub stores this online and enables you to collaborate with others (and yourself). Although git and GitHub are two different things, distinct from each other, I think of them as a bundle since I always use them together. It also helped me to think of GitHub like Dropbox: you make folders that are ‘tracked’ and can be synced to the cloud. GitHub does this too, but you have to be more deliberate about when syncs are made. This is because GitHub saves these as different versions, with information about who contributed when, line-by-line. This makes collaboration easier, and it allows you to roll-back to different versions or contribute to others’ work.

Today, we’ll interface with GitHub from our local computers using RStudio, GitHub’s Desktop App, and a touch of the command line. But there are many other ways to interact with GitHub; here is a list of git clients Jenny Bryan has put together. You have the largest suite of options if you interface through the command line, but the most common things you’ll do can be done through one of these other applications (i.e. the GitHub Desktop App).

Note: Today’s materials were developed for and borrowing from:

2 Objectives

Today, we’ll only introduce the features and terminology that scientists need to learn to begin managing their projects.

Here’s what we’ll do this morning:

  1. set up git on our local computer
  2. create a repository on github.com
  3. clone using RStudio
  4. add a few files and sync: pull, commit, push
  5. explore github.com: files, commit history, file history, blame
  6. clone using the GitHub Desktop App
  7. add a few files and sync: pull, commit, push
  8. explore github.com: files, commit history, file history, blame
  9. practice: edit/add files and sync using RStudio or GitHub Desktop (or a combination)

2.1 Why should scientists use Github?

  1. Ends (or, nearly ends) the horror of keeping track of versions. Basically, we get away from this: