Applies to: Git for Windows 2.56.0 on Windows 10, Windows 11 and Windows Server (installer details from git-scm.com and the installer’s source); Git commands tested with Git 2.53 on Ubuntu 26.04
Download the 64-bit installer from git-scm.com and click through it, or run one command with WinGet. There is no separate edition for Windows Server: you use the same installer. At the time of writing, the current release is Git for Windows 2.56.0; its release notes say that Windows 8.1 is no longer supported.
Option 1: the installer
- Open the Git for Windows download page and choose Git for Windows/x64 Setup (
Git-2.56.0-64-bit.exe). On an ARM computer, choose the ARM64 setup instead. - Run it. The defaults are sensible; these screens are worth a look:
- Choosing the default editor used by Git: the default is Vim. If you don’t know Vim, pick Notepad, Notepad++ or Visual Studio Code from the list.
- Adjusting the name of the initial branch in new repositories: choose Override the default branch name for new repositories and type
mainif that is what GitHub, GitLab or your team uses. - Adjusting your PATH environment: keep Git from the command line and also from 3rd-party software (marked Recommended). It lets you use Git in PowerShell, Command Prompt and your editor.
- Choosing the SSH executable: shown only when Windows already has
ssh.exeor PuTTY sessions. Use bundled OpenSSH is the simple choice; Use external OpenSSH makes Git use thessh.exefound on the PATH (normally the OpenSSH client that comes with Windows) instead of installing its own copy. - Configuring the line ending conversions: keep Checkout Windows-style, commit Unix-style line endings (
core.autocrlf=true). Files are stored with Linux line endings in the repository, which is what your Linux server expects. - Choose a credential helper: keep Git Credential Manager, which remembers your login for HTTPS remotes.
- Open a new PowerShell window and run
git --version. It should report version 2.56.0.
Option 2: WinGet
winget install --id Git.Git -e --source winget
According to Microsoft, WinGet is available on Windows 11, on Windows 10 version 1809 and later, and on Windows Server 2025. On Windows Server 2019 and 2022, use the installer from option 1.
WinGet can lag behind: when we checked, its repository still offered 2.55.0.5 while 2.56.0 was already out. According to the 2.56.0 release notes, 2.55.0(5) had an installer bug that turned off the Use external OpenSSH choice. If you rely on Windows’ own OpenSSH, run the 2.56.0 installer again with Only show new options unticked and choose it again.
To update later, run git update-git-for-windows, which is built into Git for Windows, or winget upgrade --id Git.Git.
First settings
Tell Git who you are. These commands behave the same on Windows and Linux; this is our test output:
git config --global user.name "Asha Nair" git config --global user.email "asha@example.com" git config --global init.defaultBranch main git config --global --list user.name=Asha Nair user.email=asha@example.com init.defaultbranch=main
Without init.defaultBranch, git init prints a long hint that starts hint: Using 'master' as the name for the initial branch and mentions that the default will change to main in Git 3.0.
Push to your own server over SSH
You don’t need GitHub to use Git: a bare repository on your VPS works as a remote. On the server:
git init --bare /srv/site.git
On your PC (SSH on port 2222 in this example):
git clone ssh://root@203.0.113.10:2222/srv/site.git cd site git add . git commit -m "first" git push origin main
In our test the push ended with * [new branch] main -> main. Use an SSH key rather than a password: generate SSH keys and set up key authentication. For a GitHub remote instead, see set up a Git repository with GitHub.
Common problems
- “git is not recognized” in PowerShell or Command Prompt: close and reopen the window after installing. If it still fails, you chose Use Git from Git Bash only; run the installer again and pick the recommended PATH option.
warning: in the working copy of 'readme.txt', LF will be replaced by CRLF the next time Git touches it: this is the line ending setting at work, not an error. We got it aftergit addwithcore.autocrlf=true.- Deleted a file by mistake: recover deleted files in Git.
Official documentation: git-scm.com: install Git on Windows and Microsoft: WinGet.
Ucartz services for this topic
- Hire an expert: engineers per 15 minutes, per hour or per month, with no contract.
- Server management: on-demand administration, hardening, migrations and monitoring.
