GitInstall Git on Windows

Install Git on Windows

Windows does not ship with Git, so you need to install it. The official installer is the most popular choice — it bundles Git itself, Git Bash (a Unix-like terminal), Git GUI (a graphical tool), and a few helpful utilities. The whole thing is about 60 MB and installs in under a minute.

Option 1 — Official installer (recommended)
  1. Go to https://git-scm.com/download/win. 2. The download starts automatically for your architecture (64-bit or 32-bit). 3. Run the downloaded .exe. 4. Click through the wizard. The defaults are fine for almost everyone — read them so you know what you are accepting.
The installer steps you should pay attention to

Most pages of the installer are safe to leave on the default. These few matter:

  • Select Components. Leave defaults checked. “Git Bash Here” and “Git GUI Here” add right-click context menu entries — useful.

  • Choosing the default editor. Pick something you already have installed. Visual Studio Code is a popular pick. If you have no editor, Notepad++ or Nano work fine.

  • Adjusting the name of the initial branch. Choose main — it is now the industry default.

  • Adjusting your PATH environment. Select “Git from the command line and also from 3rd-party software.” This lets you run git from PowerShell, cmd, or anywhere — not just Git Bash.

  • Choosing HTTPS transport backend. Use the default OpenSSL. The Windows Secure Channel option is for corporate environments with custom certificates.

  • Configuring the line ending conversions. Choose “Checkout Windows-style, commit Unix-style” unless you know you need something else.

  • Configuring the terminal emulator for Git Bash. MinTTY is the default and is the right choice.

  • Choose the default behaviour of git pull. Default (merge) is fine — you can change it later.

  • Credential Helper. Use Git Credential Manager — it stores your GitHub login securely so you do not retype passwords.

Option 2 — winget (Windows 10 / 11)

If you have the Windows Package Manager (winget), you can install Git from a terminal:

Install Git with winget

Bash
winget install --id Git.Git -e --source winget

This uses the same official installer under the hood, with default options.

Option 3 — Chocolatey or Scoop

Power users may prefer third-party package managers:

Chocolatey

Bash
choco install git

Scoop

Bash
scoop install git
Verify the installation

After the installer finishes, open a new terminal (PowerShell, cmd, Windows Terminal, or Git Bash). The “new” part matters — existing terminals will not see the updated PATH until restarted.

Verify

Bash
git --version
# git version 2.43.0.windows.1
First-time configuration

Tell Git who you are

Bash
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
git config --global init.defaultBranch main
Git Bash vs PowerShell vs cmd
  • Git Bash — a Bash shell on Windows, the same one used on macOS/Linux. Recommended for following any Git tutorial because the commands match exactly.

  • PowerShell — Microsoft’s shell. git works in it, but Linux-style commands like ls, rm, and pipes behave differently.

  • Command Prompt (cmd) — works too, but the most limited. Avoid for serious work.

  • Windows Terminal — Microsoft’s modern terminal app that can host Git Bash, PowerShell, or cmd in tabs. Highly recommended.

WSL is another option
If you are a developer who uses Linux tools regularly, install **Windows Subsystem for Linux (WSL)** and use Git inside Ubuntu. That gives you the cleanest Unix-style Git experience on Windows. See the Microsoft docs to set up WSL.
Updating Git on Windows

Newer versions of Git can update themselves:

Bash
git update-git-for-windows

Or just download and run the latest installer — it replaces the previous version in place.

Common problems and fixes
  • “git is not recognised as an internal or external command” — your terminal was open before installation. Close and reopen it. If still broken, the PATH option was unchecked during install. Re-run the installer and pick the PATH option.

  • Long path errors — Windows limits paths to 260 characters by default. Run git config --global core.longpaths true to let Git use long paths.

  • Line ending warnings (LF will be replaced by CRLF) — normal on Windows. See the “Line Endings” page in this tutorial.

  • SSL certificate errors behind a corporate proxy — your IT department may need to supply a custom certificate. Run git config --global http.sslCAInfo path/to/cert.pem.

Warning
Do not install Git into a path with spaces (like `C:\\Program Files (x86)\\…\\My Folder\\Git`) if you can avoid it. Some older scripts and hooks misbehave with spaces. The default location (`C:\\Program Files\\Git`) is fine.
Tip
Right-click any folder in Explorer and you should see “Git Bash Here” in the menu. That is the fastest way to open a terminal scoped to a project folder.