How to install Git on Windows
To install Git on Windows you use Git for Windows, the official build linked from git-scm.com. It brings the git command, Git Bash and a sign-in helper for GitHub and other hosts. This guide is for Windows 11 and works the same on Windows 10. The installer asks a dozen questions, and most of them have a sensible default.
Download Git for Windows
Open https://git-scm.com/install/windows and take Git for Windows/x64 Setup. On a PC with an ARM processor (Snapdragon and similar), take Git for Windows/ARM64 Setup. The portable versions are for running Git from a USB drive without installing it.
Run the downloaded file and allow it to make changes. The installer is in English. It can also update an older Git: it removes the previous version first and keeps your settings.
Which options to choose in the installer
The defaults suit most people. These are the pages worth reading, with the choice that the installer suggests:
- Select Components: leave the ticks as they are. Add a Git Bash Profile to Windows Terminal is handy if you work in Terminal.
- Choosing the default editor used by Git: the default is Vim. If you don’t know Vim, pick Use Notepad as Git’s default editor or Use Visual Studio Code as Git’s default editor. Git opens this editor for commit messages.
- Adjusting the name of the initial branch in new repositories: Let Git decide keeps Git’s own default. Choose Override the default branch name for new repositories and type
mainif your team uses it. - Adjusting your PATH environment: keep Git from the command line and also from 3rd-party software. Then
gitworks in PowerShell, the Command Prompt and editors like VS Code. - Choosing the SSH executable: Use bundled OpenSSH.
- Choosing HTTPS transport backend: the default Use the native Windows Secure Channel library checks certificates with Windows’ own store, which also works behind company proxies.
- Configuring the line ending conversions: Checkout Windows-style, commit Unix-style line endings, the recommended setting for projects shared with Mac and Linux.
- Configuring the terminal emulator to use with Git Bash: Use MinTTY (the default terminal of MSYS2).
- Choose the default behavior of git pull: Fast-forward only is preselected, it is now Git’s own default and stops safely when your branch and the remote have both changed. Pick Merge if you’d rather get a merge commit in that case.
- Choose a credential helper: Git Credential Manager. It signs you in to GitHub, GitLab or Bitbucket through the browser and keeps the token in Windows Credential Manager.
- Configuring extra options: keep Enable file system caching. Leave Enable symbolic links off unless your projects use symlinks.

Click Install, wait for it to finish, then close the installer. Open a new Terminal window and check the version:
git --versionThe answer names the version, for example 2.56.0.windows.2.
Install Git with winget
Windows 11 has the winget package manager built in. This command installs Git for Windows with the installer’s default options. git-scm.com notes that the winget package is not maintained by the Git for Windows team, so it can lag a little behind the latest release.
winget install --id Git.Git -e --source wingetClose Terminal and open it again so the new PATH takes effect, then check the version:
git --versionSet your name and email
Git writes your name and email into every commit. Set them once for your Windows account. Put your own name and the email you use on GitHub or GitLab in place of the examples. The third line makes main the first branch of new repositories.
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
git config --global init.defaultBranch main
git config --global --listThese settings live in C:\Users\<your name>\.gitconfig. The first push to or clone of a private repository opens a browser window to sign in. After that, Git Credential Manager remembers you.
How to update Git on Windows
Git for Windows has its own update command. It checks for a new release and runs the installer with your previous answers. If you installed Git with winget, update it with winget instead.
git update-git-for-windowswinget upgrade --id Git.Git -eIf Git doesn’t work after installing
'git' is not recognized as an internal or external command, operable program or batch file.(Command Prompt) orThe term 'git' is not recognized as the name of a cmdlet(PowerShell): close every Terminal window and open a new one, PATH is read only at start. If it still fails, run the installer again and choose Git from the command line and also from 3rd-party software, or check thatC:\Program Files\Git\cmdis in PATH.warning: in the working copy of 'index.js', LF will be replaced by CRLF the next time Git touches it: this is a notice, not an error. It comes from the line ending option you chose. Files in the repository keep Unix line endings.Filename too longwhen cloning a project with deep folders: clone again after allowing long paths for Git with:git config --global core.longpaths trueremote: Support for password authentication was removed: GitHub doesn’t accept your account password in Git. Let Git Credential Manager sign you in through the browser, or use SSH keys.
If you also work on a Mac

System Junk in MacWashing finds the caches of every app it knows, including those hidden inside app data, plus logs, Xcode junk and leftovers of deleted apps. It shows how much each takes and clears them in one go. Anything debatable stays unchecked until you decide.
Free trial · macOS 14 or later
Questions and answers
How do I install Git on Windows?
Download Git for Windows from git-scm.com and run the installer with its default options, or install it with winget in Terminal. Then open a new Terminal window and check the version: git --version
Do I need Git Bash?
No. Git works in PowerShell and the Command Prompt too. Git Bash is useful when a guide gives Linux-style commands like ls or rm, or for scripts written for Bash.
Is GitHub Desktop the same as Git?
No. GitHub Desktop is a separate app with windows and buttons for working with repositories. Git for Windows is the git command itself, which editors and build tools expect to find.