Introduction to Version Control with Git and GitHub

Learn to use version control to manage your software development and collaborate effectively with others.

In order to fully participate in this course, you should make sure you have the following in place before the first workshop.

This page gives more details on these requirements.

Please note that installing software, such as Git or a text editor, may require administrative privileges. If you need support due to not having these privileges on your computer then please contact the University’s IT department.

For those struggling to install the required software or sign up to GitHub, there will be an opportunity to get support from the course organisers in drop-in sessions shortly before the start of the course. The time available in these sessions is limited, so please only attend if you have already tried following the instructions below.

Installing Git

You should first check whether you have Git installed on your computer, according to your operating system:

If you don’t have Git installed then you will need install it. Instructions and recommended sources for doing this are provided below, according to operating systems.

Windows

Download and install the latest version of Git for Windows from https://git-scm.com/download/win. Accept the default settings while running the installer, with the following optional exceptions:

Mac OS

We recommend installing Git through the Xcode Command Line Tools. This is a collection of software, curated by Apple, that is useful for developing code on MacOS; Git is one of the programs included. Daniel Kehoe has a very good guide on the Xcode Command Line Tools. Daniel’s guide recommends installing the Homebrew package manager at the same time as the Xcode Command Line Tools, however this is not required for installing Git, so we instead recommend following the version of his instructions that avoids installing Homebrew.

Linux

Install Git using your operating system’s package manager. See https://git-scm.com/download/linux for instructions.

Get a GitHub account

To set up an account, go to https://github.com/ and click on Sign Up in the top right-hand corner. Make sure you know your username and password for the start of the course!

Text editors / IDEs

You should also have a text editor or integrated development environment (IDE) installed on your computer, to give you a means of editing text files and source code. Throughout this course we will be using Visual Studio Code (a.k.a. VS Code) because it has nice integration with Git (it’s also free and works on most operating systems). One or two parts of the course will use features in VS Code to better visualise what is going on with Git (such as visualising differences between file versions), so you will likely find it simplest to use VS Code to follow along in this course.

However, if you don’t want to use VS Code then you can use whatever text editor / IDE you feel comfortable with. Examples include:

You may wish to see if your preferred text editor / IDE has integrations with Git, or if there are plugins or other extensions that add capabilities for working with Git from within your text editor / IDE.

Installing VS Code

Head to https://code.visualstudio.com to download and install VS Code for your operating system. Windows users can also install it from the Microsoft Store.