Git - 使用 http|socks 代理加速下载内容
Summary
- 由于网络环境问题,有些时候我们不能访问到目标网络,或者线路速率低。
- 实际上修改的文件是:
~/.gitconfig
文件。
Demo
# 查看当前代理
git config --global http.proxy
git config --global https.proxy
# 使用 Http 代理
git config --global http.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
# 使用socks5代理
git config --global http.proxy socks5://127.0.0.1:1080
git config --global https.proxy socks5://127.0.0.1:1080
# 取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy
git pull
本文来自博客园,作者:duchaoqun,转载请注明原文链接:https://www.cnblogs.com/duchaoqun/p/12777180.html