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)
- 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
gitfrom 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
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
choco install git
Scoop
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
git --version # git version 2.43.0.windows.1
First-time configuration
Tell Git who you are
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.
gitworks in it, but Linux-style commands likels,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.
Updating Git on Windows
Newer versions of Git can update themselves:
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 trueto 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.