全局设置代理

1
git config --global http.proxy 'socks5h://127.0.0.1:1080'
1
git config --global https.proxy 'socks5h://127.0.0.1:1080'

取消全局代理

1
git config --global --unset http.proxy
1
git config --global --unset https.proxy

指定域名

例如github

1
git config --global http.https://github.com.proxy socks5://127.0.0.1:1080
1
git config --global https.https://github.com.proxy socks5://127.0.0.1:1080

取消代理

例如github

1
git config --global --unset http.https://github.com.proxy
1
git config --global --unset https.https://github.com.proxy