Installation

In order to use Git, you’ll need to install it first. The procedures vary depending on your operating system. You can test the availability of Git by running git --version. The output will either be the currently installed version of Git or something similar to error: command "git" not found.

$ git --version
git version 2.24.1

Linux

Most Linux distributions already come with a version of git. However, if this is not the case, you may install it via the package manager of your choice. For instance with the Advanced Packaging Tool (APT).

# e.g. Debian-based systems
$ sudo apt-get install git

# e.g. RedHat-based systems
$ sudo dnf install git

macOS

We highly recommend to install Git on macOS via the package manager Homebrew. Unfortunately the folks from Apple didn’t include such a manager of their own. Luckily you can simply install it by running a single command, how sweet is that.

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

After Homebrew was installed, you can set up Git by running the following command:

$ brew install git

Windows

Installing Git on Windows works the classic Windows way without touching the CMD at all.
You have two options:

  • Download and install Git-Bash (recommended).

  • Download and install Git only

Make sure to add git executables to your Windows PATH (it’s an option during the installation).

Post-Steps

After successfully installing git you need to update the git config for commit messages:

$ git config --global user.name "YOUR NAME"
$ git config --global user.email "YOUR@EMAIL"