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

一笑奈何 提交于 2019-12-09 19:27:43

问题


I have this error on my Android Studio running with Mac OS 10.8.3, I've installed the github client but is not necesary...

Any help?

Thanks


回答1:


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.




回答2:


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.




回答3:


Within terminal you can find your git install directory with:

git --exec-path


来源:https://stackoverflow.com/questions/20836338/error-running-gitcannot-run-program-git-error-2

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