完全解决方案:
总思路:shell走代理
首先git设置代理(你得先有自己的代理才能走下去,否则本方案失效)
Git socks5 代理设置
首先打开终端,运行以下命令:(以下命令前提:你的软件本地socks5代理端口1080)
git config --global http.proxy 'socks5://127.0.0.1:1080'
git config --global https.proxy 'socks5://127.0.0.1:1080'
查看:
cat ~/.gitconfig
发现是多了这两项配置
[http]
proxy = socks5://127.0.0.1:1080
[https]
proxy = socks5://127.0.0.1:1080
然后终端走proxy
以zsh作为说明
➜ ~ vim ~/.zshrc
添加如下代理配置: