ohi logo
OHI Science | Citation policy

What is Git/Github?

Git: Open source distributed version control system….

GitHub: Web-based Git repository hosting service

From here on, I will just refer to Github.

Why Git/Github can be confusing for scientists

Github was developed for social coding (i.e., sort of like an open source Wikipedia for programmers). Consequently, much of the functionality and terminology of Github (e.g., branches and pull requests) isn’t necessary for a scientist getting started.

These concepts are more important for coders who want the entire coding community (and not just people working on the same project) to be able to suggest changes to their code. This isn’t how most scientists will use Github.

To get the full functionality of Github, you will eventually want to learn other concepts. But, this can wait.

Goals:

  1. Only introduce the features and terminology that scientists need to learn in order to begin managing their projects.

  2. Demonstrate a workflow using R, RStudio, and Github.

Why should scientists use Github?

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



    To this:



    When you open your respository, you only see the most recent version. But, it easy to compare versions, and you can easily revert to previous versions.

  2. Improves collaborative efforts. Different researchers can work on the same files at the same time!
  3. It is easy to share and distribute files through the Github website.
  4. Your files are available anywhere! Once I forgot my powercord while traveling and couldn’t use my computer. I was able to work from another computer and had access to all my work!

Getting started

You will need to:

  1. create a Github account
  2. install the Git software on your computer (there are good instructions for installing these programs here, Section 5.1)
  3. install R and RStudio.

I only interact with Github through RStudio. There is also a stand-alone Git Gui, but I have never actually used it.

All three programs will need to be talking to each other. Usually this magically happens, but sometimes trouble shooting is required. Here is some information about fixing common errors.

If you are a student you can get the micro account which includes 5 private repositories for free (normally a $7/month value). You can sign up for the student account here. Instructors can also request a free organization account, “Request a discount”.

Some Github terminology



Create a repository on your Github account

Step 1