Git 设置代理 加快clone速度

warning: 这篇文章距离上次修改已过1343天,其中的内容可能已经有所变动。
国内访问Github本身就挺难的,但是加上长城宽带简直男上加男

当然直接修改~/.gitconfig文件也可以当然直接修改~/.gitconfig文件也可以

info:Shell走代理的方法:传送门
注意: 代理地址不要加引号,会导致gclient下载出错
1.https.proxy设置是无用的, 只需要设置http.proxy(带查证)
2.使用socks5h://更好, 查询远端DNS

Git设置代理

#设置http代理
git config --global http.proxy socks5://127.0.0.1:1080
#设置https代理
git config --global https.proxy socks5://127.0.0.1:1080
#关闭ssl验证
git config --global http.sslVerify false
git config --global https.sslVerify false

#只对github.com
git config --global http.https://github.com.proxy socks5://127.0.0.1:1080

Git 取消代理设置

#取消http代理
git config --global --unset http.proxy
#取消https代理
git config --global --unset https.proxy
#开启ssl验证
git config --global http.sslVerify true
git config --global https.sslVerify true

#取消只对github.com代理
git config --global --unset http.https://github.com.proxy
评论已关闭