Github 代码 clone 速度慢的解决办法
【摘要】 1、有代理只需要针对github设置代理即可,这里以ss为例子:#只对github.comgit config --global http.https://github.com.proxy socks5://127.0.0.1:1080#取消代理git config --global --unset http.https://github.com.proxy#只对github.comgit ...
1、有代理
只需要针对github设置代理即可,这里以ss为例子:
#只对github.com
git config --global http.https://github.com.proxy socks5://127.0.0.1:1080
#取消代理
git config --global --unset http.https://github.com.proxy#只对github.com
git config --global http.https://github.com.proxy socks5://127.0.0.1:1080
#取消代理
git config --global --unset http.https://github.com.proxy
2、没代理
2.1 换URL
可以使用github的镜像网站:
github.com.cnpmjs.org
github.com替换为上述URL即可,然后去clone,速度飞快!
2.2 配置Hosts
在ipaddress中查找github.com与github.global.ssl.fastly.net对应的ip,配置到hosts即可。
https://www.ipaddress.com/
xxxx github.global.ssl.fastly.net
xxxx github.com
例如:Ubuntu上在/etc/hosts
中添加:
复制代码
151.101.72.249 github.http://global.ssl.fastly.net
140.82.113.4 github.com
【声明】本内容来自华为云开发者社区博主,不代表华为云及华为云开发者社区的观点和立场。转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息,否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)