“git is not recognized as an internal or external command” means your shell can’t find git.exe on your PATH, even if Git is installed.
You type git, hit Enter, and you see “git is not recognized as an internal or external command”. This snag shows up on new PCs and nonstandard installs. The good news is that it’s nearly always a PATH or install-choice issue, not a broken Git binary.
It’s annoying, but fixable fast.
In this guide, you’ll pin down what Windows is searching, add the right folder once, then verify it across the shells and tools you actually use.
What Windows means when it says Git isn’t recognized
Windows runs commands by searching a list of folders stored in a variable named PATH. Each shell reads PATH when it starts. When you run a command like git, Windows scans those folders in order until it finds a match like git.exe.
If the folder that contains git.exe isn’t listed, your shell can’t launch Git and you get the message. If the folder is listed but you’re using an older window that started before the change, you can still get the same message until you restart the shell.
- Know what is missing — The error is about command discovery, not about your repo, your remote, or your credentials.
- Expect a quick fix — Once Git’s folder is on PATH, the message stops in all new terminal sessions.
- Check the current shell — The same PC can behave differently across cmd.exe, PowerShell, Git Bash, and IDE terminals.
Git Is Not Recognized As An Internal Or External Command: fastest checks first
Start with checks that take under a minute. They tell you whether Git is installed, whether you’re in the right shell, and whether PATH changes have taken effect.
- Close and reopen your terminal — Exit every open Command Prompt, PowerShell, Windows Terminal tab, and IDE terminal, then open a new one and try
git --version. - Try Git Bash once — If Git Bash opens and
git --versionworks there, Git is installed and the issue is limited to PATH or shell settings. - Locate git.exe — In File Explorer, search for
git.exe. Common locations areC:\Program Files\Git\cmdandC:\Program Files\Git\bin. - Ask Windows where git is — Run
where gitin Command Prompt. If it returns nothing, PATH is missing the Git folder for that shell.
If where git returns a path but git --version still fails, the path may point to a removed install, or you may have a permission problem. The later sections cover those edge cases.
Add Git to PATH the safe way
If Git is installed, adding the correct folder to PATH fixes the command for cmd.exe, PowerShell, Windows Terminal, and most IDEs. The cleanest route is to let the Git for Windows installer set PATH for you, then verify it with where git.
Re-run the installer with the right option
If you still have the installer, this is the lowest-friction fix because it avoids typos and chooses the intended folders automatically.
- Remove mixed installs — If you aren’t sure how Git was installed, uninstall Git for Windows first so you don’t end up with two copies.
- Install Git for Windows again — Run the installer and watch for the screen about PATH adjustment.
- Pick the recommended PATH choice — Select the option that allows Git from the command line and from third-party software.
- Finish, then reopen shells — Open a fresh terminal window and run
git --version.
Manual PATH edit when you can’t reinstall
If you can’t run installers on that PC, you can add Git’s folder to PATH yourself. Make the change at user level if you don’t have admin rights.
- Open the system variables window — Press the Windows key, type “system variables”, open the result that shows advanced system settings, then click the button for variables.
- Edit user Path — In the user section, select Path and choose Edit.
- Add the Git cmd folder — Add
C:\Program Files\Git\cmd(or your actual Git folder). This folder provides the Windows-friendly launcher that most shells expect. - Save and restart the shell — Click OK on every dialog, close every terminal window, then open a new one and run
where git.
If you found git.exe under a different location, use that folder instead. The goal is simple: the folder you add must be the one your shell should launch.
One more gotcha is Path length. If your Path is packed with old entries, you might not notice the Git folder you just added. Scroll the list and remove entries that point to apps you no longer have. Then place the Git folder above developer tools so Windows finds it.
- Remove dead folders — Delete entries that lead to missing drives or deleted programs.
- Keep one Git path — Remove duplicates so
where gitis clear.
Which Git folder should you add
Git for Windows installs multiple folders that contain Git-related executables. Adding the right one keeps behavior steady across tools, especially when your editor calls Git in the background.
| Folder to add | When it fits | What it does |
|---|---|---|
C:\Program Files\Git\cmd |
Most Windows setups | Works well in cmd.exe and PowerShell without pulling in extra Unix tools |
C:\Program Files\Git\bin |
Older setups | Exposes Unix-like tools that can shadow Windows commands in some shells |
C:\Users\ |
Per-user installs | Same idea as Program Files, but installed only for your account |
If you’re unsure, start with the cmd folder. It’s the choice Git for Windows uses when you want Git available in both Windows shells and third-party tools.
- Keep paths clean — Add the folder as a plain path with no quotes and no trailing backslash.
- Watch for duplicates — Duplicates won’t usually break Git, but they make troubleshooting harder later.
- Prefer one Git — If you see multiple Git folders, pick one and remove the rest.
Fixing Git Is Not Recognized As An Internal Or External Command after you installed Git
If you just installed Git and the error persists, your install likely went fine and your shell simply hasn’t picked up the new PATH. This is common when the installer finishes while terminals are still open, or when an IDE was launched before the install.
- Restart Windows Terminal fully — Close every tab and the window, then open it again so it reloads PATH.
- Restart your IDE — VS Code, JetBrains, and other editors can cache PATH for their integrated terminals.
- Sign out and back in — A full sign out and sign in forces Windows to reload user variables for new processes.
- Confirm with where and version — Run
where gitandgit --versionto confirm the path and the binary.
If you’re on a locked-down work PC, you may need to install Git per-user in your profile folder. That install path shows up in the table above and works fine for most workflows.
Less common causes that still show up a lot
When PATH looks correct and the error still appears, the cause is usually one of a few repeat offenders. These checks are still quick, and they prevent a lot of repeat breakage after restarts and updates.
Package manager installs that aren’t on PATH
Tools like winget, Chocolatey, Scoop, and MSYS2 can install Git into their own directories. Git may be present, yet the folder isn’t added to PATH, or it’s added only for the package manager’s own shells.
- Identify how Git was installed — Check your installed apps list, then check your package manager’s list if you use one.
- Find the active Git — Run
where gitand note the first result, since that’s what Windows will run. - Choose a single source — Keep either Git for Windows or your package manager’s Git, then remove the other to avoid mismatched tooling.
- Add the right folder — Add the folder that actually contains
git.exefor the install you keep.
Multiple Git installs fighting each other
It’s easy to end up with two versions: one from Git for Windows, one from a package manager, or one bundled with another tool. Mixed installs can leave PATH pointing to a folder that no longer exists.
- List all hits — Run
where git. If you see more than one path, note them all. - Remove the extras — Uninstall the copies you don’t use, then keep the one you trust.
- Reorder Path — Put the preferred Git folder earlier so it wins when Windows searches.
PowerShell profile lines that replace Path
Some setups edit PATH in a profile script. If a script sets PATH instead of appending to it, it can remove Git from the list every time a new shell starts.
- Open your PowerShell profile — Run
notepad $PROFILEand look for lines that assign$env:Path. - Append instead of replace — Change the line so it keeps the existing value and tacks your extra folder onto the end.
- Reload and test — Open a new shell and run
where gitagain.
Working in WSL or inside a container terminal
If you’re using WSL, Docker, or a remote dev container, you might be typing git in a Linux shell, not Windows. In that case, Windows PATH won’t help because the shell needs Linux Git.
- Check the prompt — If you see a Linux-style path like
/home, you’re not in Windows. - Install Git in that shell — Use the distro’s package tool to install Git inside WSL, then verify with
git --version. - Keep workflows separate — Use Windows Git for Windows repos, and Linux Git inside WSL repos, so tooling stays consistent.
Verify the fix and keep it from coming back
Once Git runs, take two minutes to verify that all the places you work from can see it. This prevents the same message from returning when you switch shells, change PATH again, or install another developer tool.
- Confirm the version — Run
git --versionand note the version string you expect. - Confirm the path — Run
where gitand make sure it points at the install you want. - Test your repo flow — In a repo, run
git status, thengit fetch, so you know both local and network parts work. - Check your editor terminal — Open your IDE terminal and repeat
git --versionso your tools can call Git too. - Save a one-line note — Write down the Git folder you added to Path so you can repeat it on another PC.
If you still get the error after all of this, the fastest next move is to copy the output of echo %PATH% (cmd.exe) or $env:Path (PowerShell) into a text file and search it for “Git”. That tells you what the shell is using.
