Git

These intructions should only need to be followed once or when setting up a new device.

  1. Install Git - Git is a free, open-source, software available from https://git-scm.com/. If you work within NHS National Services Scotland, request the software from IT through the Service Portal. Once authorised, this will allow you to download it from the Software Center on your machine.

This will install three applications on your computer, go to Start > Git (folder):

  • Git Bash - this is the command line (Shell) interface for Git. This will allow you to enter Git commands, i.e. git init, and can be launched by right clicking in a directory/folder and selecting “Git Bash Here”.
  • Git CMD - this is a deprecated version, similar to the Bash interface, and shouldn’t be used here.
  • Git GUI - this is Git’s version of a Graphical User Interface. This will perform the same functions as “Git Bash”, but employs a point-and-click interface instead. This guide does not cover Git GUI and instead focuses on the integrated Git GUI in RStudio.
  1. Configure your details - Git needs to know who you are, use the following commands to configure your username and email using Git Bash (if you’re a GitHub user, use the same email and username you’re registered with on GitHub. This is a necessary step for GitHub to recognise the account where the commits come from, even with proper authentication GitHub will use these details to assign the commits.) Remember not to type the arrow symbols <> when entering the command:
  • git config --global user.email <NHS email address>
  • git config --global user.name <your name>

At any time you can check what the current user details are using:

  • git config --global user.email