We are unable to run commands related to Git as in the Command Prompt on a Windows computer as the command-line interpreter is unable to find the correct path. When trying to run a ‘Git’ command, the error message says Git is not recognized as an internal or external command, whereas when trying to run a command that uses Git implicitly, we get the following error message.
Unable to find get executable in PATH; please install Git for Windows before retrying
In this post, we will see what you can do if you ever face this issue.
Unable to find Git in PATH on Windows 11/10
If you receive error message Unable to find Git in PATH on Windows, follow the solutions mentioned below.
- Restart your computer
- Install or reinstall Git on your computer
- Manually add Git to PATH
Let us talk about them in detail.
1] Restart your computer
For a change to come into action, your system needs a reboot sometimes. Since the Git path is supposed to be added to the environmental variable list, there is a high probability that it needs a restart. Hence, go ahead and restart your computer. Once that is done, re-run the command and check if the issue is resolved. This time, make sure to open Command Prompt as an administrator as extra privileges do help.
2] Install or reinstall Git on your computer
As you may already know, to run the Git command, you are required to install it on your computer. If you fail to do so, Windows will have no idea what this new command is. However, even if you have already installed Git, you have likely selected an incorrect option due to which its path is not added. That is why, we are going to run the installer again and see if that works. Follow the steps mentioned below to do the same.
- If already have Git installed on your system, you first need to uninstall the program. But if this is your first time installing Git, move to the next step.
- Navigate to gitforwindows.org to download a fresh copy of Git for Windows.
- Run the downloaded Git for Windows file and follow the installation wizard. When prompted to adjust your PATH environment, select Git from the command line and 3rd-party software, then click Next.
- Finally, reboot your computer and check if the issue persists.
Hopefully, this will resolve your issue.
Read: Fatal: Not possible to fast-forward, aborting GIT pull error
3] Manually add Git to PATH
If reinstalling Git didn’t work, we need to add the PATH manually as for some reason it’s not getting updated. To do the same, launch File Explorer and then go to the location where Git is installed, and then open the cmd folder. Copy the path and paste it somewhere accessible. Now, go back to the Git folder, open the bin, and copy the path. If you have installed Git to the default location, the two paths would be:
C:\Program Files\Git\bin
C:\Program Files\Git\cmd
Now, hit Win + S, type “Environment Variables” and open Edit the system environment variables. From the Startup and Recovery section, click on Environment Variable. In System Variables, look for Path, select it, and click on Edit. Now, click on New and add the two paths we asked you to copy earlier.
Finally, reboot your computer and check if the issue is resolved. In case, you are still unable to access Flutter, add C:\src\flutter\bin to PATH and reboot the system again.
Hopefully, you are able to resolve the issue using the solutions mentioned in this post.
Read: Remote Repository not found when cloning in GitHub
How to install Git in Windows path?
When installing Git, you will get an option to adjust PATH variables, you are required to select Git from the command line and 3rd-party software. If Git is still not added to the path, you can do that manually by following the third solution mentioned earlier.
Read: Best Git GUI clients for Windows 11.
How do I find the path of the git?
If you’re not sure where Git is installed on your computer, you can find out by opening the command line. This can be done by searching for “cmd” in the Start menu. Once you have the command line open, type “where git” and press enter. The path to Git should look something like this: “C:/Program Files (x86)/Git/bin/git.exe”.
Also Read: Find all Git Commands in one place here at Git Explorer.