Git Installation
First, create an account on GitHub (recommended) or GitLab. Both are hosting sites for online Git repositories. You can think of a repository as a bucket containing snapshots of the state of your project and all of the code within it at a given point in time. This means that if you ever change something you should have not changed, make ammendments to bugs and other issues, or would simply like to go back to the previous version of a file, you will always have all of your versions at your disposal.
Follow the instructions below for your respective OS to set up git on your machine.
Note: We will go over a “Brief Introduction To Git” during our first session.
Mac
By deafault, you will have Git available on your Mac, but if you would like to have the absolute latest version, please folow the steps outlined in this section.
- Download the latest Git for Mac installer from sourceforge.
- Once the download finishes, open the .dmg package and follow the prompts to install Git.
- Open a terminal and verify the installation was successful by typing git --version:
$ git --version
git version 2.15.0
Windows
- Download the latest Git for Windows installer.
- Run the installer and you should see the Git Setup wizard screen. You can leave most of the default options as they are, except where noted below.
Note: Git Bash is an application for Microsoft Windows environments which provides an emulation layer for a Git command line experience. It is a useful option for users to interface with git through written commands. Click here for information on using Git Bash.
Please choose the following option during installation:
Follow the Next and Finish prompts to complete the installation.
- Open a Command Prompt or Git Bash from the Start menu to start using Git.
Linux:
On Linux, you can install git using the following commands for your respective OS.
- Debian / Ubuntu (apt-get)
Git packages are available via apt:
- From your shell, install Git using apt-get (enter your password if prompted):
$ sudo apt-get update
$ sudo apt-get install git
- Verify the installation was successful by typing git --version:
$ git --version
git version 2.20.1
- Fedora (dnf/yum)
Git packages are available via both yum and dnf:
- From your shell, install Git using dnf (or yum, on older versions of Fedora):
$ sudo dnf install git
Or
$ sudo yum install git
Note: You may be asked to confirm the download and installation - enter y to confirm.
- Verify the installation was successful by typing git --version:
$ git --version
git version 2.20.1
If your OS is not listed above, please check the installation instructions here linux-other-os.