前言:今年 GitHub 的各种操作被屏蔽的挺迷的,一开始我只是以为偶尔报个连接失败的 port443 的错误,但是后来经常性的出现本地 push 不上 GitHub 的情况,在此情况记录一下各种情况(clone、pull、push……)连接不上的解决办法。
Git push出(10054)/(port 443:time out)错
git push error: RPC failed; curl 56 OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 10054
10054 的 bug 复制下面的
git config http.postBuffer 524288000
443 的 bug 复制下面的
# 设置ss
git config --global http.proxy 'socks5://127.0.0.1:10080'
git config --global https.proxy 'socks5://127.0.0.1:10080'
# 设置代理
git config --global https.proxy http://127.0.0.1:10080
git config --global https.proxy https://127.0.0.1:10080
# 取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy
在https://www.ipaddress.com/里面查找下面三个域名的 ip 地址
将其添加到本电脑 hosts 文件当中C:\Windows\System32\drivers\etc\hosts
类似下面:
CMD 窗口刷新 DNS 缓存
ipconfig /flushdns
上面两种方案理论上解决了问题,但是奇葩的问题年年有,上述两种方案都不能解决,就用如下方案:
如果 https 连接失败,使用 ssh 链连接(前提是电脑端配置了 ssh),如果 ssh 连接也不行,那就下面的针对 pull、push 失败的方案。
ssh 连接不行,那就使用 token 来连接
git push https://一串token@github.com/wztlink1013/datastructure-algorithm
评论区