Error running git“Cannot run program ”git”: error=2
This question already has an answer here:
Android Studio Checkout Github Error “CreateProcess=2” (Windows)
3 Solutions collect form web for “Error running git“Cannot run program ”git”: error=2”
Check the path registered in
Settings -> Version Control -> Git, in text box next to “
Path to Git Executable“.
It should reference a local installation of git.
If the path mentioned there doesn’t exist, that would explain the error message.
Use your terminal and check the following.
1) Check if you have installed git
You should see something like
git version 22.214.171.124
If not, there could be an error in Git installation
2) See if a
.git file exists in the directory you want to push to the remote repo.
cd <into your directory> ls -altr
You should see a file with the name
This is the file that git will use to track the repo details.
Within terminal you can find your git install directory with: