两种情况:
第一种情况自己有vpn,网页可以打开github。说明命令行在拉取/推送代码时并没有使用vpn进行代理

第二种情况没有vpn,这时可以去某些网站上找一些代理ip+port

解决办法:配置http代理Windows、Linux、Mac OS 中 git 命令相同:
配置socks5代理

1
2
git config --global http.proxy socks5 127.0.0.1:7890
git config --global https.proxy socks5 127.0.0.1:7890

配置http代理

1
2
git config --global http.proxy 127.0.0.1:7890
git config --global https.proxy 127.0.0.1:7890