我对git的学习真的好慢哦…比docker慢得多
git clone速度奇慢
参考:git clone速度太慢的解决办法,How to Restart Network Interface in Linux
思路:
git clone特别慢是因为github.global.ssl.fastly.net域名被限制了。
只要找到这个域名对应的ip地址,然后在hosts文件中加上ip–>域名的映射,刷新DNS缓存便可。
实施:
- 在网站 https://www.ipaddress.com/ 分别搜索:
| 1 | github.global.ssl.fastly.net | 
得到ip:

github.global.ssl.fastly.net的ip

github.com的ip
打开hosts文件
- Windows上的hosts文件路径在C:\Windows\System32\drivers\etc\hosts
- Linux的hosts文件路径在:/etc/hosts
- 在hosts文件末尾添加两行(对应上面查到的ip)
| 1 | 151.101.185.194 github.global-ssl.fastly.net | 
保存更新DNS
- Winodws系统的做法:打开CMD,输入ipconfig /flushdns
- Linux的做法:
| 1 | #Debian / Ubuntu Linux restart network interface | 
完成
试试git clone这条命令速度如何?