git clone速度太慢的解決辦法(親測還有效)


https://www.linuxidc.com/Linux/2019-05/158461.htm

 

1、查找域名對應的ip地址,並修改hosts文件

linuxidc@linuxidc:~/linuxidc.com$ nslookup github.global.ssl.fastly.Net
Server:  127.0.0.53
Address: 127.0.0.53#53

Non-authoritative answer:
Name: github.global.ssl.fastly.Net
Address: 151.101.229.194

linuxidc@linuxidc:~/linuxidc.com$ nslookup github.com
Server:  127.0.0.53
Address: 127.0.0.53#53

Non-authoritative answer:
Name: github.com
Address: 13.229.188.59

如下圖:

git clone速度太慢的解決辦法(親測還有效)

然后修改hosts文件

Windows上的hosts文件路徑在

C:\Windows\System32\drivers\etc\hosts

Linux的hosts文件路徑在/etc/hosts中

sudo vim /etc/hosts

git clone速度太慢的解決辦法(親測還有效)

Mac的hosts文件路徑也在/etc/hosts中

sudo vi /etc/hosts

在hosts文件末尾添加兩行

github.com 13.229.188.59
github.global.ssl.fastly.Net 151.101.229.194

git clone速度太慢的解決辦法(親測還有效)

2、刷新DNS緩存

Linux:

sudo /etc/init.d/networking restart

Windows

ipconfig /flushdns

Mac

sudo killall -HUP mDNSResponder


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM