git 错误:无法生成 C:\Path To\TortoiseGit\Bin:没有这样的文件或目录

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15139562/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 15:37:27  来源:igfitidea点击:

Error: Cannot Spawn C:\Path To\TortoiseGit\Bin: No such file or directory

gittortoisegitgit-bash

提问by Anicho

Trying to do a fetch from origin:

尝试从原点获取:

git remote update

Get the error

得到错误

Error: Cannot Spawn C:\Path To\TortoiseGit\Bin: No such file or directory
fatal: unable to fork
Error: Could not fetch origin

Why is this happening? Also is there a fix?

为什么会这样?也有解决办法吗?

采纳答案by Daniel Lee

This blog would seem to be the exact same problem that you have:

该博客似乎与您遇到的问题完全相同:

http://www.techneiq.com/2012/08/error-cannot-spawn-cprogram.html

http://www.techneiq.com/2012/08/error-cannot-spawn-cprogram.html

And this issue on msysgit also points to the same error:

而 msysgit 上的这个问题也指向了同样的错误:

https://code.google.com/p/msysgit/issues/detail?id=313

https://code.google.com/p/msysgit/issues/detail?id=313

Find out what your GIT_SSH environmental variable is pointing to and if that path has a space in it. Maybe reinstalling TortoiseGit would solve it. (Otherwise I can really recommend GitExtensionsinstead)

找出您的 GIT_SSH 环境变量指向的内容,以及该路径中是否有空格。也许重新安装 TortoiseGit 会解决它。(否则我真的可以推荐GitExtensions

回答by Tsunamis

For me the answer was removing the double quotes of "c:\Program Files (x86)\PuTTY\plink.exe" from the environment variable GIT_SSH.

对我来说,答案是从环境变量 GIT_SSH 中删除“c:\Program Files (x86)\PuTTY\plink.exe”的双引号。

回答by Yawar

I faced this problem when I was required to remove and install the TortoiseGit and Git. Previously both was installed on C:\ but later I installed those on F:. So after re-installing when I tried to pull repositories it was giving me the following error while using from context menu

当我需要删除和安装 TortoiseGit 和 Git 时,我遇到了这个问题。以前两者都安装在 C:\ 上,但后来我将它们安装在 F: 上。因此,在我尝试拉存储库时重新安装后,它在从上下文菜单中使用时给了我以下错误

error: cannot spawn C:\Program Files\TortoiseGit\bin\TortoisePlink.exe: No such file or directory

错误:无法生成 C:\Program Files\TortoiseGit\bin\TortoisePlink.exe:没有这样的文件或目录

After little bit investigation I went to Settings->Network and update the SSH Client path from C:... to F:... and then it was resolved.

经过一点调查,我转到设置->网络并将 SSH 客户端路径从 C:... 更新到 F:... 然后它就解决了。

回答by Robo Burned

Set environment variable GIT_SSHto

将环境变量设置GIT_SSH

%ProgramFiles(x86)%\PuTTY\plink.exe

or

或者

%ProgramFiles%\PuTTY\plink.exe

回答by Dakusan

For me, for TortoiseGit>Settings>Network>SSH , I had to set it to just ssh.exeinstead of the full path to ssh.

对我来说,对于 TortoiseGit>Settings>Network>SSH ,我必须将其设置为 justssh.exe而不是 ssh 的完整路径。

回答by aboutstudy

You can just find the copy the directory into the place which the error message has point out.

您只需将目录复制到错误消息指出的位置即可。