轉載自 https://blog.csdn.net/mist99/article/details/80602090
常常會苦惱於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
親測有效,是轉載別人的所以注明了轉載地址
————————————————
版權聲明:本文為CSDN博主「代丹」的原創文章,遵循 CC 4.0 BY-SA 版權協議,轉載請附上原文出處鏈接及本聲明。
原文鏈接:https://blog.csdn.net/mist99/article/details/80602090