打不死的小强
宁站着生,不躺着活

新的办法可以参考如下这个博客(注:已验证速度可以达到M/s以上,时间:2019-09-20 16:30:19)

https://blog.csdn.net/TeFuirnever/article/details/99110367

 

以下方法是几年前的老办法了,已经不实用了,仅供参考。。。

作为开发人员,github是大家的标配了,常常会苦恼于gitclone某个项目的时候速度太慢,看着控制台那几K十几K的龟速,吐血!!

原因很简单:github的CDN被伟大的墙屏蔽所致。

所以解决方案也很简单,就是手动把CDN和ip地址绑定一下。

1.获取 global.ssl.fastly地址

访问 http://github.global.ssl.fastly.net.ipaddress.com/#ipinfo 
获取cdn域名以及ip地址 
这里写图片描述

2、获取github地址

访问 http://github.com.ipaddress.com/#ipinfo 
获取cdn域名以及ip地址 
这里写图片描述

3、打开hosts映射

Windows环境

C:\Windows\System32\drivers\etc\hosts

最末尾添加两句话:

151.101.185.194 http://github.global.ssl.fastly.net 
192.30.253.112 http://github.com

然后保存就可以了。

Linux环境

sudo gedit /etc/hosts

添加

151.101.185.194 http://github.global.ssl.fastly.net 
192.30.253.112 http://github.com

保存,退出,并重启网络

/etc/init.d/networking restart

4、速度对比

添加前速度 
这里写图片描述

添加后速度 
这里写图片描述

posted on 2018-07-13 11:01  mico-going  阅读(26822)  评论(2编辑  收藏  举报