Git Guides – install git · GitHub

Install git artworkHow to install Git on

any operating system Git

can be installed on the most common operating systems such as Windows, Mac, and Linux. In fact, Git comes installed by default on most Mac and Linux machines!

Checking Git

To see if you already have Git installed, open your terminal application.

If you’re on a Mac, look for a command prompt app called “Terminal”.

  • If you’re on a
  • Windows

  • machine, open the Windows command prompt or “Git Bash”.

Once you have opened the terminal application, type git version. The output will tell you which version of Git is installed or alert you that git is an unknown command. If it’s an unknown command, read more and find out how to install Git.

Install Git using

GitHub Desktop

Installing GitHub Desktop will also install the latest version of Git if you don’t already have it. With GitHub Desktop, you get a command-line version of Git with a robust GUI. Regardless of whether you have Git installed or not, GitHub Desktop offers a simple collaboration tool for Git. You can learn more here.

Install

Git on Windows Go to the latest Git installer for Windows

  1. and download the latest version
  2. .

  3. Once the installer is launched, follow the instructions provided on the Git setup wizard screen until the installation is complete.
  4. Open the Windows command prompt

  5. (or Git Bash if you selected not to use the standard Git command prompt for Windows during Git installation).
  6. Type git version to verify that Git was installed.

Note: git-scm is a popular and recommended resource for downloading Git for Windows. The advantage of downloading Git from git-scm is that its download starts automatically with the latest version of Git included with the recommended command prompt, Git Bash. The download source is the same Git installer for Windows referenced in the previous steps.

Install Git

on Mac

Most versions of MacOS will already have Git installed, and you can activate it through the terminal with the git version. However, if you don’t have Git installed for any reason, you can install the latest version of Git using one of several popular methods listed below:

Install Git

from an

installer

  1. Go to the latest macOS Git installer and download the latest version
  2. .

  3. Once the installer has launched, follow the instructions provided until the installation is complete
  4. .

  5. Open the “terminal” command prompt and type git version to verify that Git was installed.

Note: git-scm is a popular and recommended resource for downloading Git on a Mac. The advantage of downloading Git from git-scm is that your download automatically starts with the latest version of Git. The download source is the same macOS Git installer referenced in the previous steps.

Install Git from

Homebrew

Homebrew is a popular package manager for macOS. If you already have Homwbrew installed, you can follow the steps below to

install Git:

  1. Open a terminal window and install Git using the following command: brew install git
  2. .

  3. Once the command output is complete, you can verify the installation by typing: git version.

Install

Git on Linux

Fun fact: Git was originally developed to version the Linux operating system! So, it only makes sense that it’s easy to set up to run on Linux.

You can install Git on Linux through the package management tool that comes with your distribution.

Debian/Ubuntu

  1. Git packages are available using apt
  2. .

  3. It’s a good idea to make sure you’re running the latest version. To do so, navigate to your command prompt shell and run the following command to make sure everything is up to date: sudo apt-get update.
  4. To install Git, run the following command: sudo apt-get install git-all.
  5. Once the command output is complete, you can verify the installation by typing: git version.

Fedora

Git packages

  1. are available using
  2. dnf.

  3. To install Git, navigate to the Command Prompt shell and run the following command: sudo dnf install git-all
  4. .

  5. Once the command output is complete, you can verify the installation by typing: git version.

Note: You can download the correct versions of Git and read more about installing on specific Linux systems, such as installing Git on Ubuntu or Fedora, in the git-scm documentation.

Other Git

installation methods

Looking to install Git via source code? Learn more here.

Contribute to this article on GitHub.