Git提交时fatal: unable to access 'https://github.com/1976083684/hexo-blog.git/': Recv failure: Connection was reset
有一天我在Github创建一个仓库,我想提交代码但是一直提交不上去,报各种错误,看到bug就头疼,一点受不了。
第一种bug:
fatal: unable to access 'https://github.com/1976083684/hexo-blog.git/':
Failed to connect to github.com port 443 after 21044 ms: Couldn't connect to server
翻译过来大概意思就是过了21044 ms
还是连接不到你这个github
地址的443
端口,可能原因就是网不是很好,我当时是使用了并不是很好得梯子,导致上外网有时候很慢,这种情况解决下网速应该可以了。
第二种bug:
fatal: unable to access 'https://github.com/1976083684/hexo-blog.git/':
Recv failure: Connection was reset
意思是不能访问,连接失败,已重置连接,这大概就是代理和网络问题了,因为我使用了梯子,本地的代理有时候会被改动,然后git本身有http
和https
代理,所以取消git的https
代理即可,不行再取消http
代理。
# 取消http代理
git config --global --unset http.proxy
# 取消https代理
git config --global --unset https.proxy