linux设置终端git代理

有时候克隆仓库巨慢无比,需要设置代理.
git 可以单独设置代理的.
7890是自己代理的端口

# 设置http代理
git config --global https.proxy http://127.0.0.1:7890
# 设置https代理
git config --global https.proxy https://127.0.0.1:7890
# 取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy
# 设置socks5代理
git config --global http.proxy 'socks5://127.0.0.1:7890'
git config --global https.proxy 'socks5://127.0.0.1:7890'
# 取消代理
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 --unset http.https://github.com.proxy
posted @ 2022-04-11 20:53  NikoIII  阅读(571)  评论(0编辑  收藏  举报