When you try to run a Git command like git --version or git clone in Command Prompt or PowerShell, you might see an error message that says ‘git’ is not recognized as an internal or external command,
operable program or batch file.
If this happens, don’t panic — it simply means that Windows can’t find Git in your system’s PATH.
In this guide, we’ll explain why this error occurs and walk you through easy fixes to get Git running properly on your Windows 11 PC.
Why You See the “Git Not Recognized” Error
This error appears when Git’s installation directory is not added to the Windows PATH environment variable. Essentially, the system doesn’t know where to find the Git executable file.
Here are the most common reasons:
- Git is not installed on your computer.
- Git is installed, but not added to the system PATH.
- Git installation is corrupted or incomplete.
- You’re using an incorrect terminal (like CMD without admin rights).
Now, let’s fix it step-by-step.
Step 1: Verify Git Installation
Before modifying anything, check if Git is installed on your PC.
- Press Windows + S, type Control Panel, and open it.
- Go to Programs → Programs and Features.
- Look for Git in the list.
- If Git is not listed, you’ll need to install it (see Step 2).
- If Git is installed, proceed to Step 3 to fix the PATH issue.
Pro Tip: You can also check your installation by typing this in Command Prompt:
git --version
If it still shows the “not recognized” error, move on to the next fix.
Step 2: Reinstall or Install Git Properly
If Git isn’t installed or wasn’t added to PATH during installation, reinstalling it correctly often solves the issue.
- Go to the official Git download page: https://git-scm.com/downloads
- Download the Windows setup file.
- Run the installer and follow these steps carefully:
- On the “Adjusting your PATH environment” screen, select “Git from the command line and also from 3rd-party software.”
- Click Next for all other options (default settings are fine).
- Once the installation completes, restart your computer.
Now, open Command Prompt or PowerShell and type:
git --version
If it displays the version number, you’re good to go!
Tip: Installing Git with PATH access enabled ensures you can run commands from any terminal window.
Step 3: Add Git to Windows PATH Manually
If Git is installed but not recognized, you may need to manually add its directory to your system PATH.
- Press Windows + S, search for Environment Variables, and click Edit the system environment variables.
- In the System Properties window, click Environment Variables….
- Under System variables, find and select Path, then click Edit.
- Click New, then paste the Git path (default location):
C:\Program Files\Git\binand also:C:\Program Files\Git\cmd - Click OK on all windows to save changes.
- Restart Command Prompt and type:
git --version
If it shows something like:
git version 2.xx.x.windows.x
then Git is working correctly!
Pro Tip: If you installed Git in a different directory, make sure to replace the path accordingly.
Step 4: Check PATH Configuration Using PowerShell
If Git still isn’t recognized, verify whether the PATH variable is properly set.
- Open PowerShell.
- Run:
echo $env:Path - Look for the Git installation path in the output.
If it’s missing, go back to Step 3 and add it manually.
Step 5: Open Git Bash Instead (Quick Workaround)
If you need to use Git immediately, use Git Bash — it’s installed automatically with Git and works without PATH setup.
- Press Windows + S → type Git Bash → press Enter.
- In the terminal, type:
git --versionIt should work right away.
Why this helps: Git Bash includes built-in Git access, even if Windows PATH isn’t configured.
Step 6: Run CMD as Administrator
Sometimes permission restrictions can prevent PATH updates from taking effect.
- Press Windows + S → type cmd → right-click Command Prompt → Run as administrator.
- Type:
git --version - If Git works here but not in a normal terminal, you might have user vs. system PATH conflicts.
Fix: Repeat Step 3 and ensure Git is added under System Variables, not just User Variables.
Step 7: Restart Windows Explorer (Without Rebooting)
If PATH changes don’t take effect immediately, restart Windows Explorer instead of rebooting.
- Press Ctrl + Shift + Esc to open Task Manager.
- Find and select Windows Explorer.
- Click Restart at the bottom-right.
Then, open a new terminal and try again.
Wrapping Up
If you’re seeing the “Git is not recognized as an internal or external command” error on Windows 11, it simply means your system can’t locate Git’s executable files.
The easiest fix is to reinstall Git and ensure it’s added to the PATH during setup. Alternatively, you can manually add the Git directory to your environment variables.
Once configured, restart your terminal — and you’ll be able to run commands like git clone, git pull, or git push without any issues.
With Git working properly, you can now integrate it with tools like VS Code, GitHub Desktop, or Android Studio and take your development workflow to the next level