解决github克隆慢的问题

github加速器 (不想装插件用网页)

chrome插件 (用插件后直接多了一个按钮,用按钮中的地址拉取代码就行)

 

 

--------------------------------------------------------------------------------------------------------------------------------------------------------------------

这几天克隆下载GitHub代码奇慢无比,网上搜索了一下解决方案有些不太完整,自己试验出了比较完整的解决方式:

1、在hosts文件里追加以下内容(IP需要替换掉),以下几个域名一个都不要少,有些文章只写了一部分,我一开始就少了个github.com,结果速度就还是很慢。

# GitHub Start
140.82.114.4 github.com
192.30.255.119 gist.github.com
185.199.110.153 assets-cdn.github.com
151.101.228.133 raw.githubusercontent.com
151.101.228.133 gist.githubusercontent.com
151.101.228.133 cloud.githubusercontent.com
151.101.228.133 camo.githubusercontent.com
151.101.228.133 avatars0.githubusercontent.com
151.101.228.133 avatars1.githubusercontent.com
151.101.228.133 avatars2.githubusercontent.com
151.101.228.133 avatars3.githubusercontent.com
151.101.228.133 avatars4.githubusercontent.com
151.101.228.133 avatars5.githubusercontent.com
151.101.228.133 avatars6.githubusercontent.com
151.101.228.133 avatars7.githubusercontent.com
151.101.228.133 avatars8.githubusercontent.com
185.199.109.154 github.githubassets.com
151.101.109.194 github.global.ssl.fastly.net
# GitHub End

2、IP替换方法,打开 http://tool.chinaz.com/dns ,查询域名IP映射,把以上5个域名挨个查询一下,找一个TTL值比较小的IP替换掉。注意替换前要把IP先Ping一下,确保是通的才替换,否则是无效的。

3、替换后克隆代码速度从原来的几K/s一下子上升到了10M/s,如果过一段时间速度慢下来了,就再替换一次就好了。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值