git设置代理,仅GitHub被代理,取消代理; curl使用代理

设置代理

http代理

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

socks5代理

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

取消设置

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

仅代理GitHub

1
2
git config --global http.https://github.com.proxy http://127.0.0.1:10809
git config --global https.https://github.com.proxy http://127.0.0.1:10809

取消设置

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

设置需要密码的代理

1
2
git config --global http.proxy http://username:passwd@127.0.0.1:10809
git config --global http.proxy socks5://username:passwd@127.0.0.1:10808

curl使用代理

1
curl -x socks5://127.0.0.1:10808 https://www.google.com

git设置代理,仅GitHub被代理,取消代理; curl使用代理
https://jcdu.top/2021/10/19/git设置代理,仅GitHub被代理,取消代理; curl使用代理/
作者
horizon86
发布于
2021年10月19日
许可协议