我的git客户端在尝试克隆存储库一段时间后反复失败,出现以下错误。
这里的问题是什么?
注意:我已经向GIT托管提供商注册了我的SSH密钥
Receiving objects: 13% (1309/10065), 796.00 KiB | 6 KiB/s
fatal: The remote end hung up unexpectedly
我的git客户端在尝试克隆存储库一段时间后反复失败,出现以下错误。
这里的问题是什么?
注意:我已经向GIT托管提供商注册了我的SSH密钥
Receiving objects: 13% (1309/10065), 796.00 KiB | 6 KiB/s
fatal: The remote end hung up unexpectedly
当前回答
这是由于网络连接问题,我也遇到过同样的问题。 我做了一个浅层的代码副本使用
git clone --depth 1 //FORKLOCATION
稍后取消浅化克隆使用
git fetch --unshallow
其他回答
这是由于网络连接问题,我也遇到过同样的问题。 我做了一个浅层的代码副本使用
git clone --depth 1 //FORKLOCATION
稍后取消浅化克隆使用
git fetch --unshallow
当我从由elastic beanstalk管理的AWS EC2实例上托管的远程git repo克隆数据(通过HTTP)时,我就遇到了这个问题。 克隆本身也是在AWS EC2实例上完成的。
我尝试了上述所有的解决方案以及它们的组合:
setting git's http.postBuffer settinghttp.maxrequestbuffer turning off git compression and trying "shallow" git clone and then git fetch --unshallow - see fatal: early EOF fatal: index-pack failed tunning GIT memory settings - packedGitLimit et al, see here: fatal: early EOF fatal: index-pack failed tunning nginx configuration - setting client_max_body_size to both big value and 0 (unlimited); setting proxy_request_buffering off; setting options single-request in /etc/resolv.conf throttling git client throughput with trickle using strace for tracing git clone considering update of git client
在所有这些之后,我仍然一次又一次地面临同样的问题,直到我发现这个问题是在弹性负载均衡器(ELB)切断连接。 在直接访问EC2实例(一个托管git repo)而不是通过ELB之后,我终于成功克隆了git repo! 我仍然不确定是哪个ELB(超时)参数导致了这一点,所以我仍然需要做一些研究。
更新
改变AWS弹性负载均衡器的连接耗尽策略,将超时时间从20秒提高到300秒,似乎为我们解决了这个问题。
git克隆错误和“连接耗尽”之间的关系很奇怪,对我们来说并不明显。可能是连接耗尽超时更改导致ELB配置中的一些内部更改,从而修复了过早关闭连接的问题。
这是AWS论坛上的相关问题(还没有答案):https://forums.aws.amazon.com/thread.jspa?threadID=258572
对我来说,问题是安装在MacOS上的诺顿安全。一旦我临时禁用防火墙和其他诺顿保护,我的git推送工作正常。
I was doing git push from my OS X El Capitan Mac. I was getting same error, I tried everything to fix, what I found on google/stackoverflow. As far as version is concerned I am using fairly latest version of github which is 2.7.4. I have create a project in my local system, and I wanted this to be public in my github account. Project size was not around 8MB. I noticed that when I was pushing some files of size around 1.5MB, it was pushing properly, but with large size failed for me, with same error,
我唯一的选择是在MB块中推送更改。现在我已经推送了所有更改。这是我的工作,直到我得到这个解决方案。
因此,您也可以尝试在多次提交中推动更改。或者如果你有多个文件夹,你可以按每个文件夹推送更改(如果文件夹大小不大)。
希望这将有助于你继续工作的项目。
检查网速。同时检查以下命令:
$ git config --global http.postBuffer 2M
$ git pull origin master