git报错fatal: 远端意外挂断了

git报错fatal: 远端意外挂断了

报错详细内容

mr.m@bogon tinymce % git add .           
mr.m@bogon tinymce % git commit -m 'init'
[master c6cfc2a] init
 1 file changed, 2 insertions(+), 1 deletion(-)
mr.meng@bogon tinymce % git push            
枚举对象中: 241, 完成.
对象计数中: 100% (241/241), 完成.
使用 8 个线程进行压缩
压缩对象中: 100% (226/226), 完成.
send-pack: unexpected disconnect while reading sideband packet
写入对象中: 100% (239/239), 45.93 MiB | 13.46 MiB/s, 完成.
总共 239(差异 54),复用 0(差异 0),包复用 0
fatal: 远端意外挂断了
Everything up-to-date

Git 推送错误分析

你遇到的是一个常见的 Git 推送问题。错误信息 fatal: 远端意外挂断了 通常表示在推送过程中与远程仓库的连接被意外中断。

可能的原因

  • 网络问题 - 网络不稳定或连接中断
  • 仓库大小 - 你推送的内容较大(45.93 MiB)
  • 超时设置 - Git 默认的超时时间可能不足以完成大型推送
  • 服务器限制 - 远程仓库服务器可能有大小或连接限制

解决方案

# 1. 增加Git的缓冲区大小
git config --global http.postBuffer 524288000

# 2. 增加HTTP连接超时时间
git config --global http.lowSpeedLimit 0
git config --global http.lowSpeedTime 999999

成功

git报错fatal: 远端意外挂断了_第1张图片

你可能感兴趣的:(项目,git)