我的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 config --global http.postBuffer 2M
$ git pull origin master
其他回答
如果你正在使用https,你会得到错误。
我使用https而不是http,它解决了我的问题
git config --global https.postBuffer 524288000
我必须删除git clone命令的分支标志。
上面的技巧对我没有帮助,因为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.
我也有同样的问题。这个问题的原因正如Kurtis对GNUTLS的描述。
如果你有同样的原因,并且你的系统是Ubuntu,你可以通过从ppa安装最新版本的git来解决这个问题:git-core/ppa。命令如下所示。
sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get git
这可能是因为提交的大小。按以下步骤分解提交的数量:
git log -5
查看最后5次提交,您就会知道哪些没有被推送到远程。 选择一个提交id,并将所有提交推到该id:
git push <remote_name> <commit_id>:<branch_name>
注意:我刚刚检查了我的提交,可以有最大的大小;第一次推到那时。这个把戏成功了!!