How to “Open in Git Bash” in Github Desktop

♀尐吖头ヾ 提交于 2020-06-27 05:25:21

问题


In the dropdown menu of Repository, you can see there is a button named Open in Git Bash (Ctrl + `),

when I click it, I got a warning saying:

Unable to locate Git

We were unable to locate Git on your system. This means you won't be able to execute any Git commands in the command prompt.

To help you get Git installed and configured for your operating system, we have some external resources available.

The problem is that I have already downloaded the latest Git from git-scm.com.

To conclude, how should I configure my Github Desktop or Git Bash (MingW) to make this button (Open in Git Bash) work?


回答1:


To make Github Desktop locate Git successfully, the URI of Git must be given in environment variable %PATH%.

I suggest to assign %GitPath% value of URI of Git, say C:\Program Files\Git\bin; then append %GitPath% to the end of %PATH%, and don't forget about path seperator (;).

At last, restart Github Desktop after assigning the environment variables, if it is still running.

Reference:

  • Cannot specify GIT binary directory · Issue #5454 · desktop/desktop


来源:https://stackoverflow.com/questions/52496770/how-to-open-in-git-bash-in-github-desktop

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