![](/img/trans.png)
[英]Executing Command with "cmd" That Contains Spaces Through Git-Bash?
[英]CMD Command for “Git Bash Here”
在Windows中,我可以通过打开右键菜单在当前目录中运行“Git Bash Here”。
我想将gitbashhere.bat放在默认路径中,以便从标准cmd窗口轻松访问命令。
sh.exe --login -i
命令只在sh.exe目录而不是当前目录中打开git bash。
如何查看哪个命令绑定到“Git Bash Here”?
使用regedt32
或regedit
打开注册表编辑器。
菜单“编辑”>“查找”>“查找内容”并输入“git_shell”
检查返回的注册表项。
一个将是:
HKEY_CLASSES_ROOT\\Directory\\shell\\git_shell\\command
随着价值:
"C:\\Windows\\SysWOW64\\cmd.exe" /c "pushd "%1" && "C:\\git_install_dir\\bin\\sh.exe" --login -i"
其中git_install_dir
是您安装git
的目录。
您可以看到它运行类似于以下命令:
pushd "%1" && "C:\\git_install_dir\\bin\\sh.exe" --login -i
查看特定程序如何启动的另一种方法是启动Process Explorer ,在进程列表中查找进程(对于git,这将是“git-bash.exe”)并双击该进程以打开属性。
在“图像”选项卡上有一个文本字段,用于生成进程的命令行:
那是一个windows shell的东西。 这取决于您安装的git GUI工具包。 对于tortoiseGit,在配置菜单中的某处隐藏了一个设置。 如果这不适合你:它是免费和开放的软件,所以修复:)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.