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

这里的问题是什么?

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

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

当前回答

将克隆屏幕中的源树高级选项的深度更改为25对我来说很有效

其他回答

对我来说唯一有效的方法是使用HTTPS链接而不是SSH链接克隆回购。

上面的技巧对我没有帮助,因为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 clone --depth 1 //FORKLOCATION

稍后取消浅化克隆使用

git fetch --unshallow

我发现我的问题是与.netrc文件,如果是这样,那么你也可以做以下:

打开你的.netrc文件并编辑它以包含github凭证。 输入nano ~/netrc或gedit ~/netrc

然后包括以下内容: *机器github.com

登录用户名

密码的秘密

机器api.github.com

登录用户名

密码的秘密*

你可以在那里包括你的原始密码,但出于安全考虑,在这里生成一个认证令牌github令牌,并粘贴它在你的密码的地方。

希望这对大家有所帮助

对我来说,问题是安装在MacOS上的诺顿安全。一旦我临时禁用防火墙和其他诺顿保护,我的git推送工作正常。