运行git clone等命令报错“Failed to connect to github.com port 443”的解决方案
情况简述
有科学上网工具,也开启了全局模式,但是在命令行运行git clone想搞点代码下来,一置提示:Failed to connect to github.com port 443 after xxx ms.
解决方法
为git命令配置代理端口,让git走科学上网的路子去github。格式如下
git config --global http.proxy 127.0.0.1:10809
git config --global https.proxy 127.0.0.1:10809
记得把最后冒号后面的数字(端口号)改成你的科学上网工具所用的端口号。问题即可解决!
附加部分
查看git代理命令
git config --global --get http.proxy
git config --global --get https.proxy
取消git代理命令
git config --global --unset http.proxy
git config --global --unset https.proxy