Error running git“Cannot run program ”git\": error=2 [duplicate]

萝らか妹 提交于 2019-12-04 16:24:59

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

git --version

You should see something like

git version 1.7.9.5

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 .git.

This is the file that git will use to track the repo details.

Within terminal you can find your git install directory with:

git --exec-path
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!