在国内,你肯定发现使用gitclone速度太慢了。gitclone的速度可能让你难以忍受。下面我再整理一下解决方法,分享给大家。有图有真相。原因:gitclone特别慢,因为github.global.ssl.fastly.net域名被限制了。只要找到这个域名对应的ip地址,然后在hosts文件中加入ip->域名的映射,刷新DNS缓存即可。它适用于各种操作系统。测试系统为Ubuntu18.04.2LTS,下载速度从几k提升到1M多。修改之前,gitclone的速度真的很慢,只有10K左右,如上图。修改后gitclone速度达到800k以上。或者超过1M。1、找到域名对应的ip地址,修改hosts文件linuxidc@linuxidc:~/linuxidc.com$nslookupgithub.global.ssl.fastly.NetServer:127.0.0.53Address:127.0.0.53#53Non-authoritative回答:名称:github.global.ssl.fastly.Net地址:151.101.229.194linuxidc@linuxidc:~/linuxidc.com$nslookupgithub.com服务器:127.0.0.53地址:127.0.0.53#53非权威回答:名称:github。comAddress:13.2188.59如下图:然后修改hosts文件。Windows上的hosts文件路径在C:\Windows\System32\drivers\etc\hosts。Linux的hosts文件路径在/etc/hosts。sudovim/etc/hostsMac的hosts文件路径也在/etc/hosts中sudovi/etc/hosts在hosts文件末尾添加两行github.com13.229.188.59github.global.ssl.fastly.Net151.101.229.1942,刷新DNS缓存Linux:sudo/etc/init.d/networkingrestartWindows:ipconfig/flushdnsMac:sudokillall-HUPmDNSResponder上一篇:gitclone下载速度极慢的解决方法https://www.linuxidc.com/Linux/2017-10/148116.htm
