解决办法一
修改本地的hosts文件 打开路径 C:\Windows\System32\drivers\etc\hosts
可用记事本或者VSCode或者其他编译器(没试过,vscode亲测有效)在文件末尾添加:
# GitHub Start
192.30.253.112 Build software better, together
192.30.253.119 gist.github.com
151.101.184.133 assets-cdn.github.com
151.101.184.133 raw.githubusercontent.com
151.101.184.133 gist.githubusercontent.com
151.101.184.133 cloud.githubusercontent.com
151.101.184.133 camo.githubusercontent.com
151.101.184.133 avatars0.githubusercontent.com
151.101.184.133 avatars1.githubusercontent.com
151.101.184.133 avatars2.githubusercontent.com
151.101.184.133 avatars3.githubusercontent.com
151.101.184.133 avatars4.githubusercontent.com
151.101.184.133 avatars5.githubusercontent.com
151.101.184.133 avatars6.githubusercontent.com
151.101.184.133 avatars7.githubusercontent.com
151.101.184.133 avatars8.githubusercontent.com
# GitHub End
问题得到解决。
解决办法二 如果上面失效了 替换成以下内容:
# GitHub Start
199.232.28.133 user-images.githubusercontent.com
151.101.184.133 assets-cdn.github.com
151.101.184.133 raw.githubusercontent.com
151.101.184.133 gist.githubusercontent.com
151.101.184.133 cloud.githubusercontent.com
151.101.184.133 camo.githubusercontent.com
151.101.184.133 avatars0.githubusercontent.com
199.232.68.133 avatars0.githubusercontent.com
199.232.28.133 avatars1.githubusercontent.com
151.101.184.133 avatars1.githubusercontent.com
151.101.184.133 avatars2.githubusercontent.com
199.232.28.133 avatars2.githubusercontent.com
151.101.184.133 avatars3.githubusercontent.com
199.232.68.133 avatars3.githubusercontent.com
151.101.184.133 avatars4.githubusercontent.com
199.232.68.133 avatars4.githubusercontent.com
151.101.184.133 avatars5.githubusercontent.com
199.232.68.133 avatars5.githubusercontent.com
151.101.184.133 avatars6.githubusercontent.com
199.232.68.133 avatars6.githubusercontent.com
151.101.184.133 avatars7.githubusercontent.com
199.232.68.133 avatars7.githubusercontent.com
151.101.184.133 avatars8.githubusercontent.com
199.232.68.133 avatars8.githubusercontent.com
# GitHub End
昨天配置完,解决了问题,今天再登,发现又被墙了,遂想知道问题出在哪,先说解决办法:
-
浏览器打开 https://www.ip138.com/ 网址输入 上图中 红框地址 raw.githubusercontent.com进行查询:
-
Windows系统:打开路径 C:\Windows\System32\drivers\etc\hosts,替换raw.githubusercontent.com域名前面的ip地址为查询到的任意一个ip,保存后 再次打开 github,应该就有了,亲测有效,如果哪天再出现无法加载,重复以上步骤,替换最新IP地址。
无法加载原因
我看到网上很多人说是DNS投毒所致,勤换IP吧,我别无他法,如果谁有更好的办法可以留言。
(修改IPv4里DNS地址为谷歌的8.8.8.8/8.8.4.4那个方法我试了,没效果,可能我改完没删掉 hosts里的第一行和第二行?? 先这样吧 出了问题 以后再尝试)