遇到问题
git拉取代码时报错,报错信息如下
fatal: unable to access 'https://github.com/xcmake/boke.git/': Failed to connect to github.com port 443 after 21078 ms: Couldn't connect to server
分析原因
自己有vpn,网页可以打开github。说明命令行在拉取/推送代码时并没有使用vpn进行代理
解决问题
配置 Git 使用 HTTP/HTTPS 代理 设置代理为本机,端口为7890
git config --global http.proxy http://127.0.0.1:7890 git config --global https.proxy https://127.0.0.1:7890
验证配置是否成功
git config --global --get http.proxy git config --global --get https.proxy
提示: win10电脑可以通过 设置 -> 网络和Internet -> 代理 中查看具体端口
取消代理配置(如果需要)
git config --global --unset http.proxy git config --global --unset https.proxy