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

这里的问题是什么?

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

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

当前回答

唯一对我有用的是:

克隆浅: Git克隆<yourrepo>—深度10 编辑。git/config如下:

之前

[remote "origin"]
    fetch = +refs/heads/master:refs/remotes/origin/master

[remote "origin"]
    fetch = +refs/heads/*:refs/remotes/origin/*

Git配置——global http。maxRequestBuffer 100 Git配置——global core.compression 0 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 push…从Mac终端做出的技巧,这是不同的尝试从IDE(我的情况:VSCode)导致的问题。

对于共享带宽,尝试在负载较小时进行克隆。否则,请尝试高速连接。如果仍然不工作,请使用以下命令,

git config --global http.postBuffer 2048M
git config --global http.maxRequestBuffer 1024M
git config --global core.compression 9

git config --global ssh.postBuffer 2048M
git config --global ssh.maxRequestBuffer 1024M

git config --global pack.windowMemory 256m 
git config --global pack.packSizeLimit 256m

再试着克隆一次。您可能需要根据可用内存大小更改这些设置。

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

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

sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get 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块中推送更改。现在我已经推送了所有更改。这是我的工作,直到我得到这个解决方案。

因此,您也可以尝试在多次提交中推动更改。或者如果你有多个文件夹,你可以按每个文件夹推送更改(如果文件夹大小不大)。

希望这将有助于你继续工作的项目。