Linux终端/git拉取代码设置临时网络

# 设置http/socks5
export http_proxy="http://127.0.0.1:12346/"
export https_proxy="https://127.0.0.1:12346/"
export http_proxy="socks5://127.0.0.1:12347/"
export https_proxy="socks5://127.0.0.1:12347/"
export all_proxy="socks5://127.0.0.1:22346/"
# 取消设置
unset http_proxy
unset https_proxy
unset ALL_PROXY

git设置

# 设置
git config --global http.proxy 'http://127.0.0.1:12346'
git config --global https.proxy 'http://127.0.0.1:12346'

git config --global http.proxy 'http://127.0.0.1:7890'
git config --global https.proxy 'http://127.0.0.1:7890'
# 查看
git config --global --get http.proxy
git config --global --get https.proxy
# 取消
git config --global --unset http.proxy
git config --global --unset https.proxy

参考资料:

https://www.jianshu.com/p/b88a420e98da