解决Github上传或者下载时失败的问题

总是出现push不到GitHub的问题, 这里来记录一下每次的解决方法

2023年05月28日出现问题

push代码时出现如下图所示的错误
Failed to connect to 127.0.0.1 port 1080 after 2052 ms: Connection refused
在这里插入图片描述
这种错误是我跟着教程先设置了代理

git config --global http.proxy 'socks5://127.0.0.1:1080'
git config --global https.proxy 'socks5://127.0.0.1:1080'

执行上面代码后但是会报错如上图片

然后到想要进行push的仓库位置运行

git config --global --unset http.proxy  
git config --global --unset https.proxy

执行这两段代码后再push就成功了

2023年05月28日再次出现问题

在这里插入图片描述
原因: 这样的问题往往是由于网络慢访问超时,这时候我们可以在终端选择使用设置代理和取消代理的命令解决。
先设置代理 git config --global https.proxy
再取消代理 git config --global --unset https.proxy
然后再push或者clone就可以了
在这里插入图片描述

参考:解决报错:Failed to connect to github.com port 443 after 21098 ms: Timed out

2023年05月29日出现问题

报错: fatal: unable to access ‘https://github.com/xxxxxxx/xxxxx/’: OpenSSL SSL_read: Connection was reset, errno 10054
在这里插入图片描述
此时我已经设置代理又取消代理的, 试了两次上传还是不可以, 然后我就把无线网换成了手机热点, 然后上传成功!!!

猜你喜欢

转载自blog.csdn.net/mfysss/article/details/130910821