github推送仓库出现的错误问题解决记录

本文最后更新于:2024年10月13日 下午

1、fatal: the remote end hung up unexpectedly

具体现象如下:

1
2
3
4
5
6
7
8
9
10
11
Total 47 (delta 9), reused 0 (delta 0), pack-reused 0
error: RPC failed; curl 55 Recv failure: Connection was reset
send-pack: unexpected disconnect while reading sideband packet
fatal: the remote end hung up unexpectedly
Everything up-to-date
FATAL Something's wrong. Maybe you can find the solution here: https://hexo.io/docs/troubleshooting.html
Error: Spawn failed
at ChildProcess.<anonymous> (E:\CodeLab\GitRepoLab\00-OwnCode\hexo_blog\node_modules\hexo-util\lib\spawn.js:51:21)
at ChildProcess.emit (node:events:517:28)
at cp.emit (E:\CodeLab\GitRepoLab\00-OwnCode\hexo_blog\node_modules\cross-spawn\lib\enoent.js:34:29)
at ChildProcess._handle.onexit (node:internal/child_process:292:12)

image-20231012005507571

问题原因:推送的文件太大,超出了buffer。

解决办法:

  • 修改当前仓库buffer:
1
git config --local http.postBuffer 524288000
  • 或者修改.git/config下的postBuffer属性:

image-20231012235603859

参考:https://blog.csdn.net/u013250071/article/details/81203900

2、Failed to connect to github.com port 443 after 21065 ms: Couldn’t connect to server

问题现象:

1
2
3
4
5
6
7
fatal: unable to access 'https://github.com/minixiaoxin/codestar.github.io.git/': Failed to connect to github.com port 443 after 21065 ms: Couldn't connect to server
FATAL Something's wrong. Maybe you can find the solution here: https://hexo.io/docs/troubleshooting.html
Error: Spawn failed
at ChildProcess.<anonymous> (E:\CodeLab\GitRepoLab\00-OwnCode\hexo_blog\node_modules\hexo-util\lib\spawn.js:51:21)
at ChildProcess.emit (node:events:517:28)
at cp.emit (E:\CodeLab\GitRepoLab\00-OwnCode\hexo_blog\node_modules\cross-spawn\lib\enoent.js:34:29)
at ChildProcess._handle.onexit (node:internal/child_process:292:12)

image-20231012005450572

问题原因:配置了VPN代理的原因

  • 有VPN代理,则使用下面的代理进行连接:

http代理(Ghelper使用此类型代理):

1
2
3
git config --global http.proxy 127.0.0.1:9981
git config --global https.proxy 127.0.0.1:9981
git config --global http.proxy 127.0.0.1:9981;git config --global https.proxy 127.0.0.1:9981

socket5代理:

1
2
3
git config --global http.proxy socks5 127.0.0.1:9981
git config --global https.proxy socks5 127.0.0.1:9981
git config --global http.proxy socks5 127.0.0.1:9981;git config --global https.proxy socks5 127.0.0.1:9981
  • 无代理:

查看代理

1
2
3
git config --global --get http.proxy
git config --global --get https.proxy
git config --global --get http.proxy;git config --global --get https.proxy

取消代理

1
2
3
git config --global --unset http.proxy
git config --global --unset https.proxy
git config --global --unset http.proxy;git config --global --unset https.proxy

参考:https://blog.csdn.net/zpf1813763637/article/details/128340109

3、Recv failure: Connection was reset

问题现象:

1
2
3
4
5
6
7
8
fatal: unable to access 'https://github.com/minixiaoxin/codestar.github.io.git/': Recv failure: Connection was reset
FATAL Something's wrong. Maybe you can find the solution here: https://hexo.io/docs/troubleshooting.html
Error: Spawn failed
at ChildProcess.<anonymous> (E:\CodeLab\GitRepoLab\00-OwnCode\hexo_blog\node_modules\hexo-util\lib\spawn.js:51:21)
at ChildProcess.emit (node:events:517:28)
at cp.emit (E:\CodeLab\GitRepoLab\00-OwnCode\hexo_blog\node_modules\cross-spawn\lib\enoent.js:34:29)
at ChildProcess._handle.onexit (node:internal/child_process:292:12)

image-20231012005437909

问题原因:路由问题。

解决方法:

  • 重置Git代理:
1
2
git config --global --unset http.proxy
git config --global --unset https.proxy
  • 清除DNS缓存,在cmd面板执行:
1
ipconfig/flushdns

image-20231012005358026

之后,重新提交即可:

image-20231012005550378

参考:https://blog.csdn.net/m0_69087087/article/details/128838186

4、unexpected disconnect while reading sideband packet

扩大git缓存,单位是Byte, 1048576000B=1G

1
git config --global http.postBuffer 1048576000

image-20241013155623448

参考:

https://blog.csdn.net/st75033562/article/details/132452763


github推送仓库出现的错误问题解决记录
http://www.codestar.top/2024/04/21/Git/github推送仓库出现的错误问题解决记录/
作者
mini小新
发布于
2024年4月21日
更新于
2024年10月13日
许可协议