Skip to content

Before the course

Jennifer Graham edited this page May 9, 2025 · 38 revisions

To ensure that all runs smoothly on the day, please read and follow this advice on how to prepare for the course and install the necessary software.

I - Create a GitHub Account

If you don't yet have one, create a free personal account on GitHub. This will allow you to create private or public repositories of your own code.

Account settings

GitHub now requires all users who contribute code to use two-factor authentication (2FA), to improve security on your account. New users are likely to be prompted to set this up when creating your account. However, if you created an account prior to 2023, you may need to activate this option within your account settings.

The easiest way to configure 2FA with GitHub is to use an authenticator app, as described here.

II - Install git software

Please make sure you install git software before the course.

Before downloading through the link above, please read through the relevant advice below.

Versions of git

If you installed git a while back, please check the version of your installation. This can be done through the command line by typing:

git --version

If your version is earlier than 2.39.1, please update it before the course (or install the latest version).

Token Authentication

To manage your GitHub repositories from the command line, you will need to use token authentication. This essentially works as a password, but one which has more limited access to your account and which is unique to each device you use to access GitHub. For more details see here.

If you install git for windows, you should be automatically prompted to create a token when you access a private repository for the first time (as long as your version is up to date).

For those using Mac or Linux devices, further instructions for installing git, and accessing to your GitHub account, can be found here.

If you install git using a different method, or you have an older version of git installed on your device (or HPC system), you may have to manually create a token. This process is described here.

Installing on Windows devices

You shouldn't need administrator rights for installing on Windows.

In the Windows installation wizard accept all the default settings, except for:

  • Choosing the default text editor
    • If you are not familiar with any of the editors, choose notepad.
  • Override the default branch name for new repositories
    • We recommend you set your default branch name to: main

Installing on Linux or Mac devices

There are many, many ways of installing git on Linux and Mac devices. If you are already familiar with a given package manager, try installing the git and gh packages before the workshop. Otherwise, instructions are provided for installing git using mamba, a cross platform package manager which supports installing a large number of up to date, open source packages for scientific programming and analysis across a wide range of different software environments.

Instructions for installing git, and accessing to your GitHub account, on your relevant operating system can be found here:

Using git on UEA HPC

If you plan to use git on Ada, you should access their most recent installation using: module add git

III - Test the installation

  1. Start the command line. In Windows this is done by starting "git Bash" from the start menu. In macOS or linux, just start your terminal.

  2. Issue the commands below (copy+paste)

git --version

If git is working correctly, you should see something like this:

git version x.y.z

where x.y.z is the version you installed.

  1. Check your editor of choice is correctly setup by running the following on the command line (copy+paste).
git config -- core.editor

The response should match the editor you chose on startup.

If the response is not what you expected, you can choose a different editor as follows e.g., on windows:

git config --global core.editor "notepad"

You can replace notepad with whatever editor you prefer, as suggested here.

NB. The editor chosen here is only for simple/short "commit" messages, so you do not need anything fancy - the simpler the better! Your choice will not determine the editor you use for regular day-to-day coding work.

Aside: Default editor

If you do not set an editor, the default will be vi. This is a great editor to work with, if you are familiar with it! If you are not familiar with this editor, it is not intuitive to work with.

Make sure you choose an editor that is quick, simple and easy for you to work with!

VI - Bring code/projects you want to track

At the end of the day, you will have the chance to organise some of your existing code into a repository and to put it online into a GitHub repository. So, think ahead about what might be your first repository, or if you would like any advice on how to manage a particular project ...

Optional: GUIs

This course will focus on using git from the command line.

After the course, if you'd prefer to use a graphical interface, there are a number of options you could consider. More information is available in the links provided here.

If you are an RStudio user it is possible to use many basic git operations from the IDE. See these instructions on how to integrate git with RStudio.

If you are a python user, it is possible to use many basic git operations from the pycharm IDE.

GitHub Desktop also provides a graphical user interface specifically designed to interface with repositories hosted on GitHub.com (macOS and Windows versions only).