首先自己在本地建立一个socks5代理服务器(比如地址为192.168.3.234:1080
)并且监听端口设置为1080,然后:
git config --global http.proxy 'socks5://192.168.3.234:1080'
git config --global https.proxy 'socks5://192.168.3.234:1080'
速度从平均20k上升到1M,当然这取决于你的代理服务器速度。
此设置可以在~/.gitconfig
中修改。
[http]
proxy = socks5://192.168.3.234:1080
[https]
proxy = socks5://192.168.3.234:1080