Summary and Schedule

If you’ve never heard of or used version control and Git before this is the lesson for you. We’ll start by introducing version control and exploring how it can be beneficial to researchers, then we’ll introduce some useful tools and get started with some basic workflows using these tools. We’ll build on those foundations with collaborative exercises that introduce key concepts such as forks, pull requests and branches and give you the chance to get some hands-on experience with using version control in a research setting.

Prerequisite

Prerequisites

We try not to assume too much knowledge in this lesson, making it suitable for all researchers, whatever your background. You can use either a graphical interface or a command line one, whichever you feel most comfortable with.

The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor.

This lesson uses either a graphical user interface (GUI) or the command line interface (CLI). You can use whichever one you’re most comfortable with.

There are many different interfaces to git, including many built into code editors such as VS Code, PyCharm, Emacs, and so on. We use GitHub Desktop here because its interface mostly closely maps to the standard command line interface, meaning that learning it is mostly easily transferable to other interfaces. Having just one interface also makes it easier for us to teach!

Software Setup


If you’re using a managed Windows computer (for example, the desktops in the PC rooms), then both the GUI and CLI are available from the Software Centre.

If you’re using a managed Linux machine, then the CLI git is most likely already installed.

Otherwise, you can download GitHub Desktop for the GUI, or command line git.

Creating a GitHub Account


You will need an account for GitHub to follow episodes 7 & 8 in this lesson.

  1. Go to https://github.com and follow the “Sign up” link at the top-right of the window.
  2. Follow the instructions to create an account.
  3. Verify your email address with GitHub.
  4. Configure multifactor authentication (see below).

Multi-factor Authentication

In 2023, GitHub introduced a requirement for all accounts to have multi-factor authentication (2FA) configured for extra security. Several options exist for setting up 2FA, which are summarised here:

  1. If you already use an authenticator app, like Google Authenticator or Duo Mobile on your smartphone for example, add GitHub to that app.
  2. If you have access to a smartphone but do not already use an authenticator app, install one and add GitHub to the app.
  3. If you do not have access to a smartphone or do not want to install an authenticator app, you have two options:
    1. set up 2FA via text message (list of countries where authentication by SMS is supported), or
    2. use a hardware security key like YubiKey or the Google Titan key.

The GitHub documentation provides more details about configuring 2FA.