Skip to article frontmatterSkip to article content

An interactive Git Tutorial: the tool you didn’t know you needed

Wikipedia defines version control as

Version control
Revision control, also known as version control, source control or software configuration management (SCM), is the management of changes to documents, programs, and other information stored as computer files.

Version control systems allow you to build better reproducible workflows by tracking and recreating every step of your work. A good version control tools gives you

  • Peace of mind (backups)
  • Freedom (exploratory branching)
  • Collaboration (synchronization)

Git is an enabling technology, the idea is that we can use version control for everything:

  • Paper writing (never get paper_v5_john_jane_final_oct22_really_final.tex by email again!)
  • Grant writing
  • Everyday research
  • Teaching (never accept an emailed homework assignment again!)

The plan for this tutorial

This tutorial is structured in the following way: we will begin with a brief overview of key concepts you need to understand in order for git to really make sense. We will then dive into hands-on work: after a brief interlude into necessary configuration we will discuss 5 “stages of git” with scenarios of increasing sophistication and complexity, introducing the necessary commands for each stage:

  1. Local, single-user, linear workflow
  2. Single local user, branching
  3. Using remotes as a single user
  4. Remotes for collaborating in a small team
  5. Full-contact github: distributed collaboration with large teams

In reality, this tutorial only covers stages 1-4, since for #5 there are many software development-oriented tutorials and documents of very high quality online. But most scientists start working alone with a few files or with a small team, so I feel it’s important to build first the key concepts and practices based on problems scientists encounter in their everyday life and without the jargon of the software world. Once you’ve become familiar with 1-4, the excellent tutorials that exist about collaborating on GitHub on open-source projects should make sense.