Git Setup
These instructions should only need to be followed once or when setting up a new device.
Install Git - This step is only necessary if you will be working with Git local to your machine, e.g. not on the Posit Workbench server. Git is a free, open-source, software available from https://git-scm.com/. If you work within PHS, request the software from IT through Service Now. 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.
- Git Bash - this is the command line (Shell) interface for Git. This will allow you to enter Git commands, i.e.
Configure your details - Git needs to know who you are, use the following commands to configure your username and email using Git Bash or the Terminal (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 <email address>
- use your PHS email address here.git config --global user.name <your name>
- use your GitHub username here, see GitHub Setup for more details.At any time you can check what the current user details are using:
git config --global user.email