我的git客户端在尝试克隆存储库一段时间后反复失败,出现以下错误。

这里的问题是什么?

注意:我已经向GIT托管提供商注册了我的SSH密钥

Receiving objects:  13% (1309/10065), 796.00 KiB | 6 KiB/s
fatal: The remote end hung up unexpectedly

当前回答

我也有同样的问题。这个问题的原因正如Kurtis对GNUTLS的描述。

如果你有同样的原因,并且你的系统是Ubuntu,你可以通过从ppa安装最新版本的git来解决这个问题:git-core/ppa。命令如下所示。

sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get git

其他回答

我也遇到过类似的问题,不过是竹子做的活。竹是失败的做本地克隆(本地但通过SSH代理)缓存的存储库,我删除了缓存,之后它工作了,但任何时候它试图从本地缓存克隆有一个失败。似乎是bamboo的SSH代理版本的问题,而不是git本身。

上面的技巧对我没有帮助,因为repo比github允许的最大推送大小还要大。有效的方法是来自https://github.com/git-lfs/git-lfs/issues/3758的建议,建议每次推一点:

If your branch has a long history, you can try pushing a smaller number of commits at a time (say, 2000) with something like this: git rev-list --reverse master | ruby -ne 'i ||= 0; i += 1; puts $_ if i % 2000 == 0' | xargs -I{} git push origin +{}:refs/heads/master That will walk through the history of master, pushing objects 2000 at a time. (You can, of course, substitute a different branch in both places if you like.) When that's done, you should be able to push master one final time, and things should be up to date. If 2000 is too many and you hit the problem again, you can adjust the number so it's smaller.

我也有同样的问题,这与互联网连接不好有关,所以在尝试了一些git配置后,我刚刚断开了我的网络,并再次连接,它工作了!

似乎在连接丢失(或触发此情况的操作)后,git被卡住了。

我希望这能对更多的人有所帮助。

最好的

我有同样的错误,而使用BitBucket。我所做的是从我的回购的URL中删除https,并使用HTTP设置URL。

git remote set-url origin http://mj@bitbucket.org/mj/pt.git

增加postBuffer大小和maxRequestBuffer将有助于解决这个问题。按照步骤做就可以了。

步骤:

1 .打开终端或Git Bash,用“cd”转到你想克隆repo的位置。

2.将压缩设置为0

git config --global core.compression 0

3.设置postBuffer大小

git config --global http.postBuffer 1048576000

4.设置maxRequestBuffer大小

git config --global http.maxRequestBuffer 100M

5.现在开始克隆

git clone <repo url>

6.等待克隆完成。

谢谢你!快乐编码!!