How to Install Git

How do I install Git on my computer?

Git can be installed on Windows, Mac, and Linux. Before installing, check whether you already have it.

Check if Git is already installed

  1. Open your terminal (Mac/Linux) or the Windows command prompt / Git Bash.
  2. Type git version.
  3. If Git is installed, the output shows the version number. If you see an "unknown command" message, follow the steps below.

Install on Windows

  1. Navigate to the latest Git for Windows installer and download the latest version.
  2. Follow the instructions in the Git Setup wizard until the installation is complete.
  3. Open the Windows command prompt or Git Bash.
  4. Type git version to verify the installation.

Tip: git-scm is a popular and recommended resource for downloading Git for Windows. It automatically provides the latest version along with Git Bash.

Install on Mac

Most versions of macOS already have Git installed. If not, choose one of these methods:

From an installer

  1. Navigate to the latest macOS Git Installer and download the latest version.
  2. Follow the instructions until the installation is complete.
  3. Open Terminal and type git version to verify.

From Homebrew (if Homebrew is already installed)

  1. Open a terminal window and run: brew install git
  2. Verify by typing: git version

Install on Linux

Debian/Ubuntu (using apt)

  1. Run sudo apt-get update to make sure everything is up to date.
  2. Run sudo apt-get install git-all to install Git.
  3. Verify by typing git version.

Fedora (using dnf)

  1. Run sudo dnf install git-all.
  2. Verify by typing git version.

Alternative: Install via GitHub Desktop

Installing GitHub Desktop will also install the latest version of Git if you don't already have it. It includes a command-line version of Git alongside a graphical interface.

Source: https://github.com/git-guides/install-git

Related articles