When we try to run git command on CMD or command prompt, we receive the error message “Git is not recognized as an internal or external command, operable program, or batch file”, a common error in Windows. The error occurs when the Git command-line tool is not installed or not configured correctly. This error occurs when you try to use Git commands in Command Prompt or PowerShell, but Windows cannot find the Git executable in the PATH of the windows 11/10 system.
Through this tutorial, you will learn how to set or add git environment variables path in Windows 11/10 to fix git is not recognized as an internal or external command, operable program or batch file.
Here are some common reasons for this error:
- Git Not Installed in System
- Git Path Misconfiguration
- It’s Typos Mistake
Git is not recognized as an internal or external command
Steps to add/set git environment variables path in windows 11/10 to fix git is not recognized as an internal or external command, operable program, or batch file:
- Step 1 – Go to Start and type “environment variables”
- Step 2 – Edit Environment Setting
- Step 3 – Edit System Environment Variable Path
- Step 4 – Add Git to the PATH environment variable
- Step 5 – Restart Windows CMD
- Step 6 – Test Git Version
Step 1 – Go to Start and type “environment variables”
First of all, Open the Start menu and search for “Environment Variables” and select “Edit the system environment variables.” like following:
Step 2 – Environment Setting
Then, In the System Properties window, click the “Environment Variables” button; as shown below picture:
Step 3 – Edit System Environment Variable Path
Inside the Environment Variables menu, go to the System variables submenu, select Path, then click the Edit button.; as shown below picture:
Step 4 – Add Git to the PATH environment variable
If Git is not in your PATH, you can add it by clicking “New” and adding the path to the Git executable directory (e.g., “C:\Program Files\Git\cmd”).
Click “OK” to close the “Edit environment variable” dialog, “OK” again to close the “Environment Variables” dialog, and one last “OK” to close the “System Properties” dialog.
Step 5 – Restart Windows CMD
Restart any open command prompt windows, or open a new one. Now, you should be able to run git commands from any directory within the command prompt.
Step 6 – Test Git Version
After following these steps, you should be able to use Git commands without encountering the error message. You can verify that Git is correctly installed and configured by running git --version
in the command prompt or PowerShell, which should display the installed Git version.
git --verion
If the output displays the git version, then git has been successfully added to the PATH variable.
Conclusion
That’s it, you should be able to fix the “git is not recognized as an internal or external command” error on Windows 10/11 and use git from the command line.