Git & GitHub
Contents
Git & GitHub#
Check whether you have installed already.
git --version
If not, follow the instructions for your OS and try running this commnd again.
If your version of git
is more than 18 months old (see releases), please update it.
Windows instructions:#
Install the GitHub Desktop Client.
This comes with both a GUI client as well as the Git Bash terminal client which we will use during the course. In some instances Git Bash
may need to be installed separately.
In order to use conda
with Git Bash
follow the instructions here
You will need to create an account on GitHub. You can then sign-in to the GitHub Desktop Client which should automatically set-up SSH based authentication for the terminal client.
Configure the default terminal client (there are three different flavours of terminal on Windows: Windows CMD
(DOS like), Windows Powershell
, and BASH
) to use BASH, as this most closely resembles the Linux
and macOS
terminal used by other students:
In the Desktop Client, select Tools
Then Options
Default Shell
Git Bash
You’ll know it has worked when you can open a Git Bash terminal; the window should have a title that starts with MINGW32 (scroll to the top of this page for how to check the git version).
macOS and Linux instructions:#
Installing Git on macOS
Install the XCode
command-line-tools by opening a terminal and run the following.
xcode-select --install
and follow the on screen instructions.
You may also install Xcode
from the app store if you wish, but it is not needed.
The XCode
command line tools come with Git
- please confirm you have installed it by running:
git --version
Installing Git on Linux
Install git
via your distribution package manager (e.g. apt-get
or yum
), for example:
sudo apt-get install git
Check your version by running
git --version
To use git
you will need to set up an account with your email address and name.
To do this you can follow the Your Identity section of first time git setup.
You can check that they have been set correctly by running git config user.name
and git config user.email
.
For the git
module (Version Control with Git), you will also require access to GitHub.
Follow these instructions if you are working on macOS or Linux:
Sign up, if you haven’t already
Add the public key to your GitHub account and the private key to your computer’s keychain
Lastly, you should test your SSH connection