码迷,mamicode.com
首页 > 其他好文 > 详细

小技巧-如何加快github下载代码的速度(转)

时间:2019-03-27 21:25:15      阅读:325      评论:0      收藏:0      [点我收藏+]

标签:保存   ip地址   nbsp   pad   域名   .net   div   解决   global   

作为开发人员,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、速度对比

添加前速度 
技术图片

添加后速度 
技术图片

小技巧-如何加快github下载代码的速度(转)

标签:保存   ip地址   nbsp   pad   域名   .net   div   解决   global   

原文地址:https://www.cnblogs.com/Amos-Turing/p/10610613.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!