1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| # 查看代理 git config --global --get http.proxy git config --global --get https.proxy
# 设置代理 git config --global http.proxy http://127.0.0.1:1080 git config --global https.proxy http://127.0.0.1:1080
# 取消代理 git config --global --unset http.proxy git config --global --unset https.proxy
# 只对github.com使用代理 git config --global http.https://github.com.proxy socks5://127.0.0.1:7890 git config --global https.https://github.com.proxy socks5://127.0.0.1:7890
# 取消github代理 git config --global --unset http.https://github.com.proxy git config --global --unset https.https://github.com.proxy
# ~/.ssh/config 内设置 host github.com # 若使用的是默认端口,设置如下 hostname github.com # 如果想用443端口,设置如下 # hostname ssh.github.com # port 443 user git # 如果是 socks5 代理,取消下面这行注释,并把 1080 改成自己 socks5 代理的端口 # proxycommand nc -x localhost:1080 %h %p # 如果是 http 代理,取消下面这行注释,并把 6666 改成自己 http 代理的端口 # proxycommand socat - proxy:127.0.0.1:%h:%p,proxyport=6666
|