參考:
https://github.com/chenxuhua/issues-blog/issues/3
https://github.com/ly2011/blog/issues/126
https://dbarobin.com/2017/01/24/github-acceleration-best-practices/
解決方法:修改Hosts文件
1牧抵、訪問 https://www.ipaddress.com/ip-lookup
2笛匙、分別查詢以下 5個鏈接 對應(yīng)的 IP地址,查詢一個之后犀变,在下面的“Perform another IP Lookup”框里可以繼續(xù)查詢妹孙。
github.com
gist.github.com
github.global.ssl.fastly.net
assets-cdn.github.com
raw.githubusercontent.com
assets-cdn.github.com 查詢得到如下四個鏈接,請使用cmd分別ping四個鏈接获枝,查看訪問速度最快的(ctrl+C結(jié)束ping)
185.199.108.153
185.199.109.153
185.199.110.153
185.199.111.153
ping 185.199.108.153
我本地測試蠢正,只有第三個185.199.110.153可以ping通,其他均超時映琳,所以選擇第三個机隙。
3、修改hosts文件萨西,添加內(nèi)容(因為每個人網(wǎng)絡(luò)環(huán)境不同有鹿,請務(wù)必自行采用本地查詢結(jié)果,不要直接復(fù)制;迅4邪稀!)
其中第5行到最后的IP地址源梭,都和上面第5行查詢得到IP的一樣娱俺,如:
140.82.112.3 github.com
140.82.113.4 gist.github.com
199.232.69.194 github.global.ssl.fastly.net
185.199.110.153 assets-cdn.github.com
199.232.68.133 raw.githubusercontent.com
199.232.68.133 cloud.githubusercontent.com
199.232.68.133 camo.githubusercontent.com
199.232.68.133 avatars0.githubusercontent.com
199.232.68.133 avatars1.githubusercontent.com
199.232.68.133 avatars2.githubusercontent.com
199.232.68.133 avatars3.githubusercontent.com
199.232.68.133 avatars4.githubusercontent.com
199.232.68.133 avatars5.githubusercontent.com
199.232.68.133 avatars6.githubusercontent.com
199.232.68.133 avatars7.githubusercontent.com
199.232.68.133 avatars8.githubusercontent.com
windows系統(tǒng)的hosts文件的位置如下:C:\Windows\System32\drivers\etc\hosts
mac/linux系統(tǒng)的hosts文件的位置如下:/etc/hosts
因為需要管理員權(quán)限,無法直接在文件上修改废麻,請復(fù)制hosts到桌面荠卷,更改之后再復(fù)制替換。
4.cmd運行以下代碼刷新DNS
ipconfig /flushdns
5.打開Github進(jìn)行測試烛愧,成功油宜!
下面為截圖示例:
————————————————
版權(quán)聲明:本文為CSDN博主「cxrsdn」的原創(chuàng)文章掂碱,遵循CC 4.0 BY-SA版權(quán)協(xié)議,轉(zhuǎn)載請附上原文出處鏈接及本聲明慎冤。
原文鏈接:https://blog.csdn.net/cxrsdn/article/details/102702936