One download, a few clicks, one command to check. We also cover PATH, the reason "git is not recognized" happens, and how to fix it.
Checked 4 Oct 2026 on git-scm.com: current release 2.56.0 (28 Sep 2026)
Prefer the terminal? winget install --id Git.Git -e --source winget
ILLUSTRATION macOS screens rebuilt in the browser. Pick a route. Route A needs nothing extra, route B is the one developers use.
Open Terminal (Cmd + Space, type Terminal) and run git --version.
you@MacBook-Air ~ % git --version you@MacBook-Air ~ %
macOS offers the Command Line Developer Tools, which include Git. Click Install and accept the license. (Or run xcode-select --install.)
The download takes a few minutes. When it ends, run git --version again to see a version number.
Downloading the software...
About 3 minutes remaining
Copy the one-line install command from brew.sh into Terminal and press Enter. It asks for your Mac password.
you@MacBook-Air ~ % /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
==> Checking for `sudo` access (which may request your password)...
Password:
==> This script will install:
/opt/homebrew/bin/brew
Press RETURN/ENTER to continue...Run brew install git. Wait for the beer mug.
you@MacBook-Air ~ % brew install git ==> Fetching git ==> Downloading https://ghcr.io/v2/homebrew/core/git ######################################## 100.0% ==> Pouring git--2.56.0.arm64_sequoia.bottle.tar.gz 🍺 /opt/homebrew/Cellar/git/2.56.0: done you@MacBook-Air ~ %
Run git --version. Any version number means success.
you@MacBook-Air ~ % git --version git version 2.56.0 you@MacBook-Air ~ %
Source: git-scm.com/install/mac
sudo apt install gitsudo dnf install gitsudo pacman -S gitSource: git-scm.com/install/linux
ILLUSTRATION A faithful replica of the Git 2.56.0 for Windows setup wizard, rebuilt in the browser (not a screenshot). Click inside it like the real thing. The green tag marks the choice we recommend.
The installer added Git Bash, a terminal that speaks the same commands as macOS and Linux. Every chapter after this one uses it. macOS and Linux learners: your Terminal already does this, skip ahead.
On Windows 11 the short menu hides Git Bash. Choose Show more options, or press Shift + F10.
Home
Gallery
Desktop
Documents
Downloads
Music
The full menu now has Open Git Bash here. Windows 10 shows this menu straight away.
Home
Gallery
Desktop
Documents
Downloads
Music
Type git --version and press Enter. A version number means Git is installed and on your PATH.
you@PC MINGW64 ~/Documents/myproject $ git --version git version 2.56.0.windows.1 you@PC MINGW64 ~/Documents/myproject $
The screens are illustrations rebuilt in the browser. Menu wording can differ a little between Windows and Git versions.
When you type git, the terminal does not search your whole disk. It only looks inside a short list of folders called PATH. If Git's folder is not on the list, you get "git is not recognized" even though Git is installed.
Step A: tap each PATH folder to search it for git.exe.
Step B: Git lives in C:\Program Files\Git\cmd. Add it to PATH.
In real life: re-run the installer and choose the recommended PATH option, or search "Edit the system environment variables", open Environment Variables, select Path, Edit, New, paste the folder. Then close and reopen the terminal. Old windows keep the old list.
Ask Git for its version. Any version number means success.