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
- Open your terminal (Mac/Linux) or the Windows command prompt / Git Bash.
- Type
git version. - If Git is installed, the output shows the version number. If you see an "unknown command" message, follow the steps below.
Install on Windows
- Navigate to the latest Git for Windows installer and download the latest version.
- Follow the instructions in the Git Setup wizard until the installation is complete.
- Open the Windows command prompt or Git Bash.
- Type
git versionto 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
- Navigate to the latest macOS Git Installer and download the latest version.
- Follow the instructions until the installation is complete.
- Open Terminal and type
git versionto verify.
From Homebrew (if Homebrew is already installed)
- Open a terminal window and run:
brew install git - Verify by typing:
git version
Install on Linux
Debian/Ubuntu (using apt)
- Run
sudo apt-get updateto make sure everything is up to date. - Run
sudo apt-get install git-allto install Git. - Verify by typing
git version.
Fedora (using dnf)
- Run
sudo dnf install git-all. - 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.