加快github下载速度

作为开发人员,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

猜你喜欢

转载自www.cnblogs.com/wind-chaser/p/11326478.html