She*_*rzo 14 git console2 git-bash github-for-windows
我试图让Windows的Github的bash shell被Console2包装.这并不像我希望的那么容易.从git-scm.com开始,使用Git for Windows非常容易.我知道我可以将这个bash shell与Console2一起使用没有问题,而且,我真的很好奇如何使用Github for Windows bash shell做到这一点.由于Github for Windows和Git for Windows之间的名称相似,我在搜索解决方案时遇到了挫败感.

从git-scm.com mysysgit(即Git for Windows)中包装bash shell非常简单,因为它附带了一个sh.exe.您只需在Console2设置中填写Shell:字段,例如:
"C:\Program Files (x86)\Git\bin\sh.exe" --login -i
Run Code Online (Sandbox Code Playgroud)

我的问题是你如何让Github for Windows bash shell在Console2内部打开?
在Github for windows中,Shell字段没有简单的路径和可执行文件.你可以做的是进入Github for Windows的选项并设置一个自定义程序,并指向Console2,如下所示:

真正的诀窍是什么进入Console2设置?什么进入Shell:字段来获取Console2中的bash shell?如果你选择了bash shell来查看Github for Windows的shell命令的目标,你会得到一些奇怪的东西:
C:\Users\10136196\AppData\Local\GitHub\GitHub.appref-ms --open-shell
Run Code Online (Sandbox Code Playgroud)
这与Github for Windows使用的Microsoft一键安装功能有关,这在我的实验中的Console2设置Shell:字段中不起作用.
She*_*rzo 19
我直接从Github for Windows寻求帮助.我收到了一个非常迅速的回复,其解决方案很有效.
有两个步骤:
1)将默认shell的Github for Windows选项设置为Custom,并为Console.exe设置路径和可执行文件.我已经这样做了,上面的问题中有截图.(确保点击该更新按钮以保存更改)
2)在"选项卡"部分的Console2"Shell"文本框中,您需要将其放入:
bash.exe --login -i
不需要路径,只需要名为bash.exe的可执行文件(这对我来说很神奇).控制台设置应如下所示:

一些问题...我被建议将控制台2设置中的启动目录留空(我认为这是为了使Gitub for Windows GUI中的启动目录得到尊重)并且Github for Windows选项卡应该是第一个在标签列表中.我发现的另一个问题是,您无法再直接使用Console.exe来启动shell.您必须使用已安装的Github for Windows shell快捷方式.

否则,您将收到一条错误消息"无法启动bash.exe --login -i!"