提高 git 访问 github 速度
网络代理前提:
- 请开启代理(梯子)
- 检查代理端口(可能会有所不同)
文章目录
- [1. git 配置参数列表命令:](#1. git 配置参数列表命令:)
- [2. git 添加 http 代理](#2. git 添加 http 代理)
- [3. git 取消 http 代理](#3. git 取消 http 代理)
1. git 配置参数列表命令:
bash
git config --list
2. git 添加 http 代理
两个http 差别不大,只是增加(或减少)一个字母
s
。选择下面其中一个就可以。
- http / https 代理
根据 http 端口设置,我这里端口为 10809
:
bash
git config --global http.proxy http://127.0.0.1:10809
bash
git config --global https.proxy https://127.0.0.1:10809
- socks 代理
根据 socks 端口设置,我这里端口为 10808
bash
git config --global http.proxy 'socks5://127.0.0.1:10808'
bash
git config --global https.proxy 'socks5://127.0.0.1:10808'
3. git 取消 http 代理
bash
git config --global --unset http.proxy
bash
git config --global --unset https.proxy
参考
附录
我的代理端口截图如下:
