Skip to content
02Install guides · 5 min

Install git

git saves versions of your project so you (and your agent) can see every change and undo mistakes. Almost every coding tool expects it.

Roman Urdu: git aap ke project ka har version save krta ha, ghalti ho toh wapas ja sakte hein. Har coding tool isay use krta ha.

Cost: Free, open source.

Windows

  1. Easiest: download the standalone installer from git-scm.com/install/windows and click Next through the defaults. It also gives you Git Bash, which Claude Code can use.
  2. Or, from PowerShell, with winget (this package is not maintained by the Git for Windows team, but works):
    $ winget install --id Git.Git -e --source winget
  3. Close and reopen the terminal so it finds git.

macOS

  1. Apple ships git with the Command Line Tools. Run this and click Install in the window that opens:
    $ xcode-select --install
  2. Or, if you use Homebrew:
    $ brew install git

Linux (Ubuntu/Debian)

  1. Ubuntu, Debian and WSL:
    $ sudo apt update
    $ sudo apt install git
  2. Fedora:
    $ sudo dnf install git

Android (Termux)

  1. Install Termux from F-Droid or GitHub releases. The Google Play build is marked experimental, with missing features; the Termux team says most people should use F-Droid or GitHub. Needs Android 7 or newer.
  2. In Termux:
    $ pkg update
    $ pkg install git

Check it worked

$ git --version

git version 2.x.x (2.56.1 was the newest on 2026-12-05)

Common errors

git is not recognized as an internal or external command (Windows)
Close every terminal window and open a new one. If it still fails, run the installer again and keep the default PATH option.
winget is not recognized
Use the standalone installer from git-scm.com instead, or install App Installer from the Microsoft Store.
macOS: "xcode-select: error: command line tools are already installed"
git is already there. Run git --version.
"Please tell me who you are" on your first commit
Set your name and email once: git config --global user.name "Your Name" and git config --global user.email "you@example.com".

Official docs

Checked against these pages on 2026-12-05. Tools change: if a step differs, the official page wins.