访问 github.com 时,仓库的图片都无法显示

解决办法:

修改hosts文件

1.打开一个文件夹
2.command + shift + g
3.输入/private/etc/hosts,前往
4.先备份hosts文件,再修改
5.文件内容是:

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1   localhost
255.255.255.255 broadcasthost
::1             localhost

这里的操作是把最后一行删除,保存
仓库的图片就能显示了


然而

头像却依旧没有显示

找出未显示头像的URL(通过 fn + F12 进入调试模式)
再去这个网站:https://www.ipaddress.com/
解析出 IP 地址
最后把IP 域名添加到 hosts文件中

这里的操作是
添加下面的内容最 hosts 文件最后

# Github Start

199.232.28.133 avatars0.githubusercontent.com
199.232.28.133 avatars1.githubusercontent.com
199.232.28.133 avatars2.githubusercontent.com
199.232.28.133 avatars3.githubusercontent.com
199.232.28.133 raw.githubusercontent.com
199.232.28.133 raw.github.com

# Github End

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容