github代理加速或 CDN 加速

下面的命令只针对github.com,在国内还可能会用到gitee.com,所以不能将所有的git站点都添加上代理。

查看已有配置

git config --global -l

设置代理

git config --global http.https://github.com.proxy socks5://127.0.0.1:1086

取消代理

git config --global --unset http.https://github.com.proxy

CDN加速

git config --global url."https://ghproxy.com/https://github.com".insteadOf "https://github.com" 

或者:

git config --global url."https://hub.fastgit.org/".insteadOf "https://github.com/"

cdn 加速二选一使用。

但因为没有官方 CDN,上面两个都是用爱发电,没准哪天就挂了。

可以前往~/.gitconfig手动删除git 配置信息里面的信息

转自:https://segmentfault.com/a/1190000040117804

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容