Cygwin git fork() 拉动错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12042363/
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-19 07:22:30  来源:igfitidea点击:

Cygwin git fork() error on pull

gitcygwin

提问by Gus

The basic problem is that sometimes when I do

基本问题是,有时当我这样做时

git pull upstream master

I get

我得到

remote: Counting objects: 172, done.
remote: Compressing objects: 100% (57/57), done.
remote: Total 119 (delta 45), reused 95 (delta 21)
      0 [main] git 8660 fork: child -1 - forked process 4520 died unexpectedly, retry 0, exit code -1073741515, errno 11
error: cannot fork() for index-pack: Resource temporarily unavailable
fatal: fetch-pack: unable to fork off index-pack

The exit code is the same every time, the number of objects varies as doe the process numbers of course. I am running with public key authentication against github via ssh on Windows 7. It happens with and without ssh-agent. I've been having this problem for several months now, and working around it by switching over to run Git Bash (MingW32), whenever it crops up, (which is almost every time with some repositories and occasionally or never with others). However I generally prefer the Cygwin environment and have most of my stuff setup there, so it's a drag when I'm forced to do that.

每次退出代码都是一样的,当然,对象的数量和进程数量一样。我在 Windows 7 上通过 ssh 使用针对 github 的公钥身份验证运行。无论是否使用 ssh-agent,都会发生这种情况。几个月来我一直有这个问题,并通过切换到运行 Git Bash (MingW32) 来解决它,每当它突然出现时,(几乎每次都有一些存储库,偶尔或从不与其他存储库)。然而,我通常更喜欢 Cygwin 环境并且我的大部分东西都在那里设置,所以当我被迫这样做时,这是一个拖累。

A while ago I saw this post http://cygwin.com/ml/cygwin/2012-03/msg00025.htmland after reading it hoped that the next time I updated Cygwin that fix would fix my issue too. It didn't, but I wasn't sure if the fix was released, but I updated again today and it's happening.

前段时间我看到了这篇文章http://cygwin.com/ml/cygwin/2012-03/msg00025.html阅读后希望下次我更新 Cygwin 时,该修复程序也能解决我的问题。它没有,但我不确定修复是否已发布,但我今天再次更新并且它正在发生。

I've noticed a plethora of emails about errors relating to fork() for Cygwin git on the web, though none for pull, and so my question is, has anyone seen this on pull before, what causes it? is there any way to keep it from happening (besides patching git or cygwin or using some other implementation course :) ).

我注意到网络上有大量关于 Cygwin git 的 fork() 相关错误的电子邮件,尽管没有用于 pull,所以我的问题是,有没有人在 pull 之前看到过这个,是什么原因造成的?有什么方法可以防止它发生(除了修补 git 或 cygwin 或使用其他一些实现课程 :) )。

Amusingly I've seen exactly none of the errors for which I can find relevant Cygwin/git mails on the web.

有趣的是,我完全没有看到可以在网上找到相关 Cygwin/git 邮件的错误。

回答by Martin Thomson

This is addressed here: http://cygwin.wikia.com/wiki/Rebaseall

这是在此处解决的:http: //cygwin.wikia.com/wiki/Rebaseall

In short, close all windows and run this:

简而言之,关闭所有窗口并运行:

C:\cygwin\bin\dash.exe -c '/usr/bin/rebaseall -v'

This fixes all related issues with forking. I had issues with forking aspell from emacs as well as git.

这解决了所有与分叉相关的问题。我在从 emacs 和 git 分叉 aspell 时遇到了问题。

回答by Bill Hoffman

OK, I guess I should share. I have the same problem, but I have a workaround. The problem seems to be the length of the PATH. If I do a git pull, I get the fork failure:

好吧,我想我应该分享。我有同样的问题,但我有一个解决方法。问题似乎是路径的长度。如果我执行 git pull,我会得到 fork 失败:

$ git pull*emphasized text*
      2 [main] git 7384 fork: child -1 - forked process 7420 died unexpectedly, retry 0, exit code -1073741515, errno 11
error: cannot fork() for rev-list: Resource temporarily unavailable
error: Could not run 'git rev-list'
remote: Counting objects: 728, done.
remote: Compressing objects: 100% (456/456), done.
 907550 [main] git 7384 fork: child -1 - forked process 7436 died unexpectedly, retry 0, exit code -1073741515, errno 11
error: cannot fork() for index-pack: Resource temporarily unavailable
fatal: fetch-pack: unable to fork off index-pack

However, if I set the PATH to something really small before running git, it works:

但是,如果我在运行 git 之前将 PATH 设置为很小的值,它会起作用:

$ PATH=/usr/bin git pull
remote: Counting objects: 728, done.
remote: Compressing objects: 100% (456/456), done.
remote: Total 464 (delta 337), reused 9 (delta 6)
Receiving objects: 100% (464/464), 153.36 KiB, done.
Resolving deltas: 100% (337/337), completed with 107 local objects.
From git://cmake.org/cmake

I would be interested if it works for any of you?

如果它适用于你们中的任何人,我会感兴趣吗?

回答by RootCode

I also faced same problem and restart of the system resolved it.

我也遇到了同样的问题,重启系统就解决了。

回答by N Phillip Cole NPC

I get that some time has passed, but I found this searching for my own very similar issue, using the cygwin platform built into the MobaXterm app. Was pulling my nonexistent hair out trying to figure it out, in the end it was fixed by a simple restart.

我知道已经过了一段时间,但我发现这是在寻找我自己非常相似的问题,使用 MobaXterm 应用程序中内置的 cygwin 平台。正在拔出我不存在的头发试图弄清楚它,最后它通过简单的重启修复了。

I double verified that this worked with a second Windows 10 machine, a new installation of MobaXterm + git apps, and an attempt to pull from a github repo. Same error: "error: cannot fork() for index-pack: Resource temporarily unavailable" was achieved, and a simple computer reboot fixed it.

我再次确认这可以与第二台 Windows 10 机器、MobaXterm + git 应用程序的新安装以及从 github 存储库中提取的尝试一起使用。同样的错误:“错误:无法 fork() for index-pack:资源暂时不可用”已实现,并通过简单的计算机重启修复了它。

回答by codesnip3r

Instead of setting the PATH variable or using git's full path (once), this should work as well:

而不是设置 PATH 变量或使用 git 的完整路径(一次),这也应该有效:

git=`which git`
git pull

This will assign git to it's full path for consecutive calls. Now, if git is used in another program(like make), it will be able to.

这会将 git 分配给连续调用的完整路径。现在,如果 git 用于另一个程序(如 make),它将能够。