• 开了 VPN 之后使用 Git 连接 github 的 clone pull push 命令依旧很慢,是由于 git 默认不使用代理导致,配置 git 代理后可提升速度。

1. 配置Git代理

  • 打开Git bash窗口输入以下命令
1
2
3
4
5
6
7
# windows系统
git config --global http.proxy http://127.0.0.1:{port}
git config --global https.proxy http://127.0.0.1:{port}

# MacOS系统
git config --global http.proxy socks5://127.0.0.1:{port}
git config --global https.proxy socks5://127.0.0.1:{port}

2. 查询Git代理

1
2
3
4
git config --global --list

git config --global --get http.proxy
git config --global --get https.proxy

3. 取消Git代理

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