问题
如图:
参考链接
解决Git连接失败:Failed to connect to github.com port 443 after 21090 ms: Couldn‘t connect to server
这通常发生在使用VPN后,系统端口号与Git端口号不一致时。
查询代理端口
设置Git端口号
git config --global http.proxy 127.0.0.1:4780
git config --global https.proxy 127.0.0.1:4780
验证设置
git config --global -l
重新git push即可
总结
问题场景 | 解决办法 | 重要命令 |
---|---|---|
使用VPN时 | 调整Git代理设置 | git config --global http.proxy, git config --global https.proxy |
未使用VPN时 | 取消Git代理设置 | git config --global --unset http.proxy, git config --global --unset https.proxy |