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:
Only introduce the features and terminology that scientists need to learn in order to begin managing their projects.
Demonstrate a workflow using R, RStudio, and Github.
Why should scientists use Github?
- 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.
- Improves collaborative efforts. Different researchers can work on the same files at the same time!
- It is easy to share and distribute files through the Github website.
- 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:
- create a Github account
- install the Git software on your computer (there are good instructions for installing these programs here, Section 5.1)
- 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
- Organization: The Github account (e.g., nazrug).
- Repository: A folder within the organization that includes files dedicated to a project.
- Local Github: Copies of Github files located your computer.
- Remote Github: Github files lcoated on the https://github.com website.
- Clone: Process of making a local copy of a remote Github repository. This only needs to be done once (unless you mess up your local copy).
- Pull: Copy changes on the remote Github repository to your local Github repository. This is useful if multiple people are making changes to a repository.
- Push: Save local changes to remote Github
Create a repository on your Github account
Step 1
