我的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
当前回答
在/etc/resolv.conf中,将这一行添加到文件的末尾
options single-request
其他回答
我必须删除git clone命令的分支标志。
这是由于网络连接问题,我也遇到过同样的问题。 我做了一个浅层的代码副本使用
git clone --depth 1 //FORKLOCATION
稍后取消浅化克隆使用
git fetch --unshallow
当我通过ssh克隆存储库时,建议的解决方案都不适用。然而,我能够使用https克隆,然后后来将远程更改为ssh通过:
git remote set-url origin git@github.com:USERNAME/REPOSITORY.git
解决WIFI路由器设置:
当我在wifi设置PPPoE(通过wifi路由器自动登录)时,我也遇到了同样的问题。
Git下载速度非常慢15kb。
packet_write_wait: Connection to 17.121.133.16 port 22: Broken pipe 致命的:对端意外挂机 致命:早期EOF 致命:索引包失败
解决方案: 1. 更改设置为动态IP,重新启动wifi路由器。 2. 从web浏览器登录到Internet服务提供商门户(不配置PPPoE,从wifi路由器自动登录)。
修改后的Git下载速度为1.7MiB。
上面的技巧对我没有帮助,因为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.