Skip to content

Installing Git on Windows 11

Overview

This guide explains how to install the latest stable version of Git for Windows, configure it for first use, and verify it works.

What you'll do

  • Install Git and add it to your PATH
  • Configure username, email, and default branch
  • Optionally integrate with your preferred editor

Before you start

Take a VM snapshot before installing new tools.


Prerequisites

  • Windows 11 VM running
  • Internet access
  • Administrator permissions
  • (Optional) Text editor such as VS Code or Notepad++

Helpful links


Steps

1. Download Git

  1. Open a browser.
  2. Navigate to https://git-scm.com/download/win.
  3. Download the 64-bit installer (.exe).
  4. Save to Downloads or a Tools folder.

2. Install Git

  1. Run the installer .exe.
  2. Accept defaults unless you need customization. Key options:
  3. Add Git to PATH (important)
  4. ✅ Choose “Git from Command Prompt” or “Git and optional Unix tools”
  5. ✅ Select default editor (VS Code recommended)
  6. ✅ Choose main as default branch name
  7. ✅ Enable file system caching
  8. (Optional) Enable credential manager
  9. Finish the setup wizard.

Caution

Double-check the PATH option — without it git won’t run in PowerShell or CMD.


3. Verify Installation

Open PowerShell 7 or CMD and run:

git --version

Expected output:

git version 2.x.x.windows.x

4. Configure Git (First Time Only)

Set your identity:

git config --global user.name "Your Name"
git config --global user.email "you@example.com"

Set default branch name:

git config --global init.defaultBranch main

(Optional) Set VS Code as the default editor:

git config --global core.editor "code --wait"

Verification

  • git --version returns the installed version
  • git config --list shows username, email, and default branch
  • git init runs without errors in a test folder

It worked if…

  • git --version shows installed version
  • Your identity is set with git config --list
  • You can initialize a repo with git init

Troubleshooting

  • git not recognized → PATH not updated → log out/in or reinstall with PATH enabled
  • Credential prompts every time → enable Credential Manager during install or configure SSH keys
  • Default branch shows master → update with git config --global init.defaultBranch main

Common issues

  • PATH not set → reinstall with correct option
  • Wrong branch default → update config manually

References