git clone速度太慢解决方案

 

原文地址:https://blog.csdn.net/hzwwpgmwy/article/details/79043251
适用各种操作系统,本次测试于ubuntu,下载速度从二十几k提高到二百多k

1、查找域名对应的ip地址,并修改hosts文件

nslookup github.global.ssl.fastly.Net
nslookup github.com 
  • 1
  • 2

在这里插入图片描述
将下列内容加入 /etc/hosts文件中

151.101.76.249 http://global-ssl.fastly.net
192.30.255.113 http://github.com  #此处112还是113根据自己的情况调整?
  • 1
  • 2

2、刷新DNS缓存
linux:

sudo /etc/init.d/networking restart
  • 1

windows:

ipconfig /flushdns
  • 1

mac:

 sudo killall -HUP mDNSResponder
  • 1

我的是mac,我的配置完速度就上来了,并没有执行什么命令,也没有重启。
参考:

原文地址:https://www.cnblogs.com/lvdongjie/p/11194340.html