Windows 11 can display “git is not recognized as an internal or external command” even when a developer has downloaded Git. The cause is usually an absent installation, an incorrect PATH entry or a terminal opened before installation. This guide separates Command Prompt, PowerShell, Git Bash, VS Code and WSL so you can repair the correct environment without risking project files.
Documentation Review: November 2026. Instructions are based on official Git, GitHub and Microsoft references; actual installer screens may change between releases. No claim is made that every Windows installation was physically tested.
Run git --version in a newly opened terminal. If Git is not installed, obtain Git for Windows from the official download page. If Git Bash works but PowerShell does not, check where.exe git and confirm that the real Git cmd folder appears in PATH. Restart VS Code after changing the environment. Do not run development tools as administrator merely to hide a PATH problem.
Five-Step Git Diagnostic Workflow
Command Examples
git --version
where.exe git
# PowerShell:
Get-Command git
# After Git is working:
git config --global user.name "Your Name"| Where Git Fails | Check First | Safer Response |
|---|---|---|
| Every Shell | Installed Git | Official Installer |
| PowerShell Only | PATH And Shell Restart | Verified Git Directory |
| VS Code Only | Editor Environment | Restart Editor |
| WSL Only | Linux Distribution | Approved Linux Git Installation |
| Git Works But Push Fails | Remote Authentication | Handle Separately |
Understand What The Error Actually Means
The error “git is not recognized as an internal or external command” in Command Prompt, or “The term ‘git’ is not recognized” in PowerShell, means that the shell cannot resolve an executable named git using its current command search paths. It does not necessarily mean your repository is corrupt, your source files have disappeared, or the remote hosting service is unavailable. The most common explanations are that Git was never installed, its executable folder was not added to PATH, or the terminal was opened before installation changed the environment.
Begin by writing down which application produced the error. A Windows Command Prompt, PowerShell session, Git Bash window, Windows Subsystem for Linux shell and Visual Studio Code terminal can use different environments. The correct repair should target the environment that is failing, rather than making broad edits to Windows settings. Never delete project files because a command cannot be found.
Check Whether Git Is Already Installed
Open the Windows Start menu and look for Git Bash or an installed Git for Windows entry. You can also check Installed apps for a Git installation. The presence of a Git Bash shortcut suggests that Git for Windows may be installed, but it does not establish that the plain git command will work from every terminal. Open Git Bash if available and run git –version.
If Git Bash reports a version while PowerShell does not, the problem is likely command resolution for PowerShell rather than a completely missing Git installation. If neither shell has Git and there is no installed application, proceed to the authentic Git installer. A version result also does not prove that a particular repository or remote account has been configured; it only confirms that the executable can run.
Run Git Version In The Affected Terminal
In the terminal where the problem occurs, enter git –version and read the exact output. A working Git installation normally prints a Git version string. Command Prompt and PowerShell phrase their errors differently, so record the message rather than translating it into a guessed diagnosis. Do not run elevated commands just to test the version.
A command-not-found error occurs before Git can inspect any project. You do not need to be inside a repository to run git –version. If the command works in one window but not another, keep both windows available as comparison evidence. That observation is usually more useful than running an operating-system repair or uninstalling VS Code.
Compare Git Bash With PowerShell
Git Bash typically configures its own execution environment and makes the Git binary available there. PowerShell relies on the executable search paths visible to its process. If Git Bash succeeds while PowerShell fails, a PATH configuration or stale terminal environment is a strong possibility. Run the same version command in both shells and record the result without altering the installation yet.
Do not assume that Git Bash is unsafe or that PowerShell is broken. They are different command environments designed for different workflows. Some development teams choose Git Bash, while others use PowerShell or the integrated VS Code terminal. The useful long-term fix is the one that supports your intended workflow with a documented and legitimate Git installation.
Use The Official Git For Windows Download
When Git is absent, obtain Git for Windows from the official Git project installation page at git-scm.com. The official project documentation identifies the Windows installer and links to the maintained distribution. Choose an installer compatible with your computer and the installer options appropriate to your use. Avoid advertisements claiming to provide special Git drivers or one-click command repairs.
Downloading from a trusted source is as important as repairing PATH. Malicious software can imitate familiar development tools and request unnecessary privileges. Our Fake Software Download Button guide explains how to verify download destinations. If a workplace controls developer software installation, use its approved package channel rather than bypassing restrictions with an unofficial portable copy.
Choose Installer Options Deliberately
The Git for Windows installer presents configuration choices that can influence terminal access and defaults. On versions that offer a PATH-related choice, a common option allows Git to be used from the command line and third-party applications. The wording can change between versions, so examine the option description rather than copying an old screenshot literally.
Do not select every optional integration just because a tutorial suggests it. The goal is for the approved Git executable to be accessible in the development terminal you use. Other installer choices, including default editor, line-ending behavior and credential support, can matter for project compatibility but do not directly explain why the shell cannot find git.exe. Review them according to your team’s requirements.
Close And Reopen Terminals After Installation
A terminal process receives an environment when it starts. If the installer updates PATH while PowerShell, Command Prompt or VS Code remains open, the old process may still use the previous search path. Close the affected terminal and open a fresh one before changing the registry or manually editing PATH. Run git –version again.
An old integrated terminal can remain alive inside a long-running editor. If opening a new terminal tab does not help, close and restart the editor normally after saving work. Avoid restarting the entire PC before trying the low-risk process restart. If a fresh terminal now recognizes Git, the likely cause was a stale environment and no other system modification is required.
Check Git Resolution With Where Exe
On Windows, where.exe git can help show which git.exe file can be located using the current environment. In PowerShell, the explicit where.exe syntax avoids confusion with the where alias. If the result lists a legitimate installed Git executable, verify that it belongs to the intended Git for Windows installation. If it returns no matching files, the current command path may not include the correct directory.
The command is diagnostic and should not modify anything. More than one entry can indicate multiple Git versions, such as one provided by another developer tool. Do not delete the first entry merely because its location looks unfamiliar; first determine which installation the editor and terminal actually use. A consistent interpreter and executable location is more valuable than maximizing the number of Git copies installed.
Use Get Command In PowerShell
PowerShell provides Get-Command git to inspect how the shell resolves a command. The returned path and command type can help distinguish an executable from an alias or function. If the command does not resolve in PowerShell but works in Git Bash, compare the environments before reinstalling.
Use the actual path shown by the command as evidence. On managed systems, a script or shell function might intentionally wrap a developer command. Do not override a workplace toolchain without permission. Avoid treating Git’s own command configuration as a substitute for a working operating-system search path: git config settings are read only after Git has been found.
Find The Legitimate Git Executable Folder
For an ordinary Git for Windows installation, the directory containing the command-line Git executable is commonly under the installed Git directory, such as C:\Program Files\Git\cmd. However, the actual location depends on the installer and whether the product was installed per-user or to a custom directory. Verify the path in File Explorer and confirm that git.exe exists before using it in a PATH setting.
Do not create a fake directory or download a standalone git.exe from an unknown site to make the command work. A legitimate installation supplies supporting programs and documentation. If the installer placed Git elsewhere, use that actual directory, not a hard-coded internet example. Record the path so it can be used consistently by your editor and any build tools.
Inspect The PATH Variable Without Editing It
Open Windows environment-variable settings, or inspect the PATH value visible to your terminal. The PATH variable is a list of directories searched for commands. A valid Git directory must be included as a separate entry; it is not enough for the Git installation folder to exist on disk. The Microsoft environment-variable reference explains that each process inherits values from its environment.
Inspect first, modify second. A missing entry can explain the problem, but an existing entry may simply not be visible to a terminal that was started before installation. If the entry is correct, open a fresh terminal and test again before proceeding. Our Windows Environment Variables guide provides additional context about user and system scope.
Add Git To User PATH When Appropriate
If Git is legitimately installed but its command directory is absent from the environment used by your account, an authorized user PATH entry can make it available to your terminals. Use the Windows graphical environment-variable editor and create one entry for the verified directory containing git.exe. Prefer a user-level edit for a personal development setup unless an administrator has defined a machine-wide toolchain.
Back up or record the existing value before modifying it, especially on an older machine with many tools. Do not erase unrelated PATH entries or replace the entire variable with the Git directory. After saving, open a new PowerShell or Command Prompt window and run git –version. If the command still fails, confirm the exact folder and terminal environment rather than adding duplicate entries repeatedly.
Avoid Editing System PATH Without Need
System PATH changes can affect every user and many services on a computer. They generally require broader permissions and may not be needed for a personal Git installation. On a work device, system-level environment variables may be managed by IT or deployment policy.
Do not elevate a terminal simply because an online answer says to add Git to system PATH. A properly installed per-user developer tool may function without administrative changes. If an organization needs a standard machine-wide Git deployment, follow its supported provisioning procedure. Broad changes can unintentionally alter which command other applications run when multiple versions are installed.
Know What Happens When PATH Contains The Wrong Directory
Adding C:\Program Files\Git alone may not work if git.exe is actually inside a cmd subdirectory. The shell searches directory entries for executable names; it does not recursively search every folder below them. Similarly, adding a path to a shortcut rather than the real executable location will not necessarily make the binary resolvable.
Use File Explorer to confirm the precise location and inspect a fresh terminal with where.exe git. Avoid guessing from memory or mixing the location of Git Bash with the path of command-line Git. If you have a portable Git distribution, its documented PATH requirements may differ from a normal installer; use the instructions for the distribution you actually selected.
Check PATH Ordering When Multiple Git Versions Exist
If where.exe git lists more than one executable, the earliest matching entry can determine which Git version Command Prompt launches. Development tools can bundle their own Git clients. A project might therefore work in Git Bash while another terminal uses an older bundled executable.
Do not simply delete duplicate installations while other software depends on them. Identify which version you intend to use, why it appears first and whether the team has a supported configuration. Test git –version in each intended environment after any controlled adjustment. If the problem is specifically command not recognized, the absence of a matching path matters more than disagreements about which installed version should take priority.
Understand VS Code Terminal Environment Differences
VS Code’s integrated terminal normally inherits a process environment from the editor, and the selected shell can introduce additional configuration. An editor launched before Git installation may continue to use an outdated PATH even after a new terminal pane is opened. Close VS Code after saving work and reopen it from a fresh session before changing Git settings.
Our VS Code Terminal guide covers how to choose the intended shell and read terminal output. You can compare git –version in standalone PowerShell and in the integrated terminal. If it works outside but not inside VS Code, the editor’s environment or terminal profile deserves attention. Reinstalling Git is not always necessary.
Check VS Code Git Path Settings Only When Necessary
VS Code supports Git integration and can use a configured Git executable path in specialized setups. If its source-control view reports that Git cannot be found but the terminal command works, investigate the editor’s Git integration settings and extension logs. On most standard Git for Windows installations, normal PATH discovery is preferable to hard-coding a location.
Do not confuse an editor integration error with an operating-system terminal error. Use the exact failing component as the starting point. A source-control extension may be disabled or an organization policy may limit certain features, while plain Git continues to work normally. Restore the intended editor settings rather than altering Windows PATH when only an extension is misconfigured.
Handle Git Inside Windows Subsystem For Linux Separately
A WSL shell runs inside a Linux environment, even when it is displayed in Windows Terminal. Its executable search path and package management can differ from Windows PowerShell. Git installed for Windows is not necessarily equivalent to installing Git inside a Linux distribution. Run git –version in the actual WSL distribution to determine whether that environment has Git available.
Use the Linux distribution’s approved package manager or documented installation procedure if Git is absent there. Do not edit Windows system PATH solely to solve a missing Linux command. Keep Windows and Linux repositories organized and avoid unintentionally crossing file systems in workflows where permissions and line-ending behavior differ. The correct tool installation belongs to the environment where the commands execute.
Separate Git From GitHub Authentication
Git is the version-control program on the computer, while GitHub is a remote hosting and collaboration service. You can run git –version without a GitHub account or network connection. Problems with SSH keys, HTTPS credential prompts or repository permissions occur only after the Git executable can run.
If Git is recognized but git clone or git push fails, read that new error independently. Do not reinstall Git simply because a remote service denies authentication. The GitHub setup documentation covers account and remote configuration after the local tool works. Our Open Source Software guide also explains how local development tools differ from the hosting services used to share source code.
Set Git Identity After The Command Works
Once git –version succeeds, configure your author name and email if you intend to create commits. The official Git book describes git config –global user.name and git config –global user.email. These settings identify commit authors and are separate from authentication to a remote service.
Do not run git config before you have confirmed that Git itself is available in the terminal. Avoid using someone else’s email or a shared machine identity without consent, especially where commits will be published publicly. A missing author identity may cause a commit error, but it cannot explain the shell’s original message that git is not recognized.
Test Git In A Harmless Directory
For a final functional check, open a user-owned temporary development folder and run git –version followed by git status only if it is already a repository. If it is not a repository, Git may report “not a git repository,” which is evidence that the command now runs and is a different problem.
Do not initialize Git in a Windows system directory or a folder containing unrelated sensitive files simply to test installation. You can use git init in a fresh disposable folder if you need a repository test, then remove only that known test folder afterward. Avoid creating a repository inside another project inadvertently. Keep diagnostic actions reversible and separate from production work.
When Git Commands Work Only As Administrator
If Git becomes available only when you open a terminal as administrator, the account environments may differ. Administrative sessions can run under another user context or inherit a different PATH. This is not a reason to conduct ordinary source-control work with elevated privileges.
Compare the two sessions’ command locations and user-level PATH, then configure the intended account’s legitimate Git installation. Running developer tools with unnecessary privilege can increase the impact of malicious scripts or accidental file changes. On managed systems, ask IT to establish a standard installation rather than making personal work dependent on an elevated terminal.
Avoid Untrusted Git Repair Utilities
Websites sometimes promise to solve missing Git with a driver updater, a DLL download or a registry cleaner. None of those is the ordinary repair path for an absent or undiscoverable Git executable. Such tools may bundle unwanted programs or require excessive privileges.
Prefer the official Git installer, Windows environment-variable controls and normal shell diagnostics. Review the developer’s authentic domain before downloading any package. A security-minded approach is especially important because Git workflows often interact with source code, credentials and build scripts. Repairing a tool should not expose the projects it is intended to protect.
Check Whether Security Software Blocked Git
In some managed environments, application control or endpoint protection can prevent git.exe from running. This generally yields a different message from an ordinary command-not-found error, but users may describe both as Git not working. Inspect the exact warning and any authorized security notification.
Do not disable antivirus, Windows Defender or organization policies to make Git run. Verify the executable publisher and source, then ask the administrator to evaluate the block. An ordinary PATH problem should be handled by correcting the path, while a real application-control event requires a security decision. Keeping those categories separate avoids masking potentially meaningful protection.
Create A Troubleshooting Decision Table
Use this sequence to avoid unnecessary work: if neither Git Bash nor PowerShell can run git and no installation exists, install from the official project. If Git Bash works but PowerShell fails, inspect PATH and reopen the shell. If standalone PowerShell works but VS Code does not, restart the editor and inspect the integrated terminal. If WSL alone fails, examine Git inside that distribution.
If Git runs but a remote operation fails, move to repository or authentication diagnostics rather than repeating installation steps. Record only the relevant versions and paths and keep private repository URLs and tokens out of screenshots. The best repair is the smallest change that makes the intended command work consistently.
Verify The Repair After A Restart
After applying a valid fix, open a fresh terminal and confirm git –version. Then check where.exe git or Get-Command git to verify which executable is selected. Open VS Code or another editor that previously failed, run the command there and confirm source-control integration if it is relevant to your work.
A repair is more dependable when it survives a normal restart or editor relaunch and does not break other development tools. Document the chosen installation source, executable path and whether it uses user or system PATH. This prevents teammates from copying an unsafe administrative workaround and makes future Windows updates or Git upgrades easier to troubleshoot.
Frequently Asked Questions
Why Does Windows Say Git Is Not Recognized?
The terminal cannot find a git executable in its current command search paths, often because Git is absent, PATH lacks the correct folder, or the terminal has not been reopened after installation.
How Do I Check Whether Git Is Installed?
Try git –version in a new PowerShell window and Git Bash if installed; inspect Installed apps and the official Git for Windows installation.
Should I Install Git From GitHub?
Use the authentic Git project download page or an organization-approved package channel. GitHub hosts repositories but is not the only provider of the Git program.
Which Git Folder Belongs In Windows PATH?
Use the verified directory containing git.exe, commonly the cmd folder inside the Git for Windows installation. Do not copy a path that does not exist on your PC.
How Do I Check Which Git Windows Is Using?
Run where.exe git in Command Prompt or PowerShell and inspect Get-Command git in PowerShell.
Why Does Git Work In Git Bash But Not VS Code?
The editor may have an old environment or use another terminal profile. Restart VS Code after verifying Git in a fresh standalone terminal.
Do I Need Administrator Mode To Fix Git?
Usually no. A trusted normal installation and appropriate user PATH are preferable for routine development.
Does Git Config User Name Fix Command Not Recognized?
No. Git config runs only after the Git executable is available; author identity and command discovery are separate problems.
Can WSL Use The Same Git Installation As PowerShell?
WSL uses a Linux environment with its own command availability and configuration, so verify or install Git inside the intended distribution.
How Do I Confirm Git Works Now?
Run git –version in each intended terminal, inspect the executable path, then perform a harmless command in a test project.
Official Documentation
Primary references: Git Official Windows Installation; Git Book: Installing Git; Git Book: First-Time Configuration; GitHub: Set Up Git; GitHub: Getting Started With Git; Git Reference: Version Command; Microsoft: Windows Environment Variables; Git Book: Getting A Git Repository. Match each procedure to the exact Git installation and environment you use.



