[英]Git for Windows, setting GIT_SSH to a shell file causes causes “error: cannot spawn <path>: No such file or directory”
On Windows 10
, using Git-2.4.6-5th-release-candidate-64-bit.exe
, if I do: 在Windows 10
,如果执行以下操作,请使用Git-2.4.6-5th-release-candidate-64-bit.exe
:
set GIT_SSH=D:\ssh.sh
I get: 我得到:
error: cannot spawn D:\ssh.sh: No such file or directory
fatal: unable to fork
But if I instead do: 但是,如果我改为:
set GIT_SSH=D:\ssh.exe
or: 要么:
set GIT_SSH=D:\ssh.bat
everything works as intended. 一切都按预期进行。
My PATHEXT
: 我的PATHEXT
:
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.sh
A registry file that has been applied: 已应用的注册表文件:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Classes\Applications\bash.exe]
[HKEY_CURRENT_USER\Software\Classes\Applications\bash.exe\shell]
[HKEY_CURRENT_USER\Software\Classes\Applications\bash.exe\shell\open]
[HKEY_CURRENT_USER\Software\Classes\Applications\bash.exe\shell\open\command]
@="\"C:\\sdk\\Git\\bin\\bash.exe\" \"%1\" %*"
[HKEY_CURRENT_USER\Software\Classes\Applications\sh.exe]
[HKEY_CURRENT_USER\Software\Classes\Applications\sh.exe\shell]
[HKEY_CURRENT_USER\Software\Classes\Applications\sh.exe\shell\open]
[HKEY_CURRENT_USER\Software\Classes\Applications\sh.exe\shell\open\command]
@="\"C:\\sdk\\Git\\bin\\sh.exe\" \"%1\" %*"
[HKEY_CLASSES_ROOT\sh_auto_file]
[HKEY_CLASSES_ROOT\sh_auto_file\shell]
[HKEY_CLASSES_ROOT\sh_auto_file\shell\open]
[HKEY_CLASSES_ROOT\sh_auto_file\shell\open\command]
@="\"C:\\sdk\\Git\\bin\\sh.exe\" \"%1\" %*"
[HKEY_CLASSES_ROOT\sh_auto_file\ShellEx]
[HKEY_CLASSES_ROOT\.sh]
@="sh_auto_file"
[HKEY_CLASSES_ROOT\.sh\DefaultIcon]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,69,00,6d,00,\
61,00,67,00,65,00,72,00,65,00,73,00,2e,00,64,00,6c,00,6c,00,2c,00,2d,00,36,\
00,38,00,00,00
[HKEY_CLASSES_ROOT\.sh\shell\edit]
[HKEY_CLASSES_ROOT\.sh\shell\edit\command]
@="\"C:\\Program Files\\Sublime Text 3\\sublime_text.exe\" \"%1\""
The result of these is that if I open up cmd
and enter: 这些的结果是,如果我打开cmd
并输入:
D:\ssh.sh
or even: 甚至:
D:\ssh
the script is executed. 脚本被执行。
But git refuses to use the shell script, but is content to use .exe
files and .bat
files. 但是git拒绝使用shell脚本,但满足于使用.exe
文件和.bat
文件。
Why is this? 为什么是这样? Is it a bug, or am I missing something? 是一个错误,还是我缺少了什么?
For some totally unexplained reason, I can verify that NOW it works in both cmd
and git bash
whilst it didn't before. 由于某些完全无法解释的原因,我可以验证它现在在cmd
和git bash
中都可以运行,而以前却没有。
Now on to creating a git-repo preprocessor for ssh so multi-account users have it easier. 现在开始为ssh创建git-repo预处理程序,以便多帐户用户更轻松。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.