Chapter 9 Git and Github

With our guest lecturer, Seb James

9.1 Motivation

Git is an incredible common tool among software developers and computer scientists. It has powerful functionality for coordinate code projects across many people. As a core data science tool I want everyone on the course to have had some exposure to it, and to recognise the key concepts (as well as the value it has). We will not be using the full functionality in the course.

9.2 Before the class

Create an account on github.com, if you don’t already have one.

Install git on your machine.

Until you do that you DON’T have the git features enabled in RStudio.

9.3 Accessing git

If you have RStudio you can access git using point and click (top right), or via the terinmal (the tab next to Console on the bottom right).

Outside of RStudio:

  • Students using windows can install: https://gitforwindows.org/ Once installed they should be able to open a git bash window and type git --version
  • Students on a Mac will have git if they install ‘Xcode’ and ‘Command line tools for Xcode.’They can test by opening a terminal and typing git --version

9.4 Resources for the class

This week’s class is taught by Seb James. Links to his materials are below

Examples of two published projects supported by Github repos

9.5 Checklist

Git and github are fundamental tools which will be relevant for collaborating on reliable computational projects, but it is not essential you master the full range of capabilities they offer for this module.

By the end of this class you should

  • have a github account
  • installed git on your local machine
  • understand why git is useful for code projects
  • recognise the essential terminology: repo/repository, remotes and local, clone, branches, commit, merge, rebase, push/pull

9.6 Resources

Official documentation: github pages

Understanding Git Conceptually

git/github guide a minimal tutorial

Vuorre, M., & Curley, J. P. (2018). Curating research assets: A tutorial on the git version control system. Advances in Methods and Practices in Psychological Science, 1(2), 219-236.