今天在Idea里向github提交代码,遇到了这两个错误:
1.Failed to connect to github.com port 443 after 21070 ms: Couldn't connect to server
2.Recv failure: Connection was reset
这是由于本机系统代理端口和git端口不一致导致的。
解决办法:
查看代理:
cmd命令行修改git配置:
(其中的7890改为你电脑的端口号)
git设置代理
git config --global http.proxy http://127.0.0.1:10809
git config --global https.proxy http://127.0.0.1:10809
然后再push一下就可以了
题外话:
还有一种方式是配置ssh
参考:https://blog.csdn.net/CoderSharry/article/details/131249905
取消代理命令
git config --global --unset http.proxy
git config --global --unset https.proxy
参考: