如何在 Github 桌面中 "Open in Git Bash"

How to "Open in Git Bash" in Github Desktop

Repository 的下拉菜单中,您可以看到一个名为 Open in Git Bash 的按钮(Ctrl + `),

当我点击它时,我收到一条警告:

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.

问题是我已经从git-scm.com下载了最新的Git。

总而言之,我应该如何配置我的 Github 桌面或 Git Bash (MingW) 来制作此按钮(在 [=36= 中打开) ] Bash)工作?

要使 Github Desktop 成功定位 Git,必须在环境变量 %PATH%.

中提供 Git 的 URI

我建议给Git的URI赋%GitPath%值,比如说C:\Program Files\Git\bin;然后将 %GitPath% 附加到 %PATH% 的末尾,并且不要忘记 路径分隔符 (;).

最后,分配环境变量后重启Github Desktop,如果还是运行。

参考:

这件事今天发生在我身上。即,即使我为 Windows 安装了 Git(包括 git bash),我仍然收到相同的警告对话框。

我只想向遇到此问题的任何人指出,即使它说“不使用 Git 打开”也是一种误导。按下该按钮将打开 'git bash',其中将包含 'git'。

正如前面(也是正确的)答案所解释的那样,出现此对话框只是因为它在路径上找不到 git。 “仅”更新路径可防止 dialog/warning 出现。