GitHub加速指南进阶版

这个有什么用?最直观的效果是GitHub图片可以正常加载,网页也稳定了。

GitHub Hosts主要是通过修改host的方式加速GitHub访问,解决图片无法加载以及访问速度慢的问题。

  • 主站: https://github.com/ineo6/hosts
  • 镜像地址: https://gitee.com/ineo6/hosts

使用方式

hosts

内容定时更新,最近更新时间:2021-09-06 10:24:53。

最新版请从前文中的站点地址获取。

# GitHub Host Start

185.199.108.154              github.githubassets.com
140.82.114.22                central.github.com
185.199.108.133              desktop.githubusercontent.com
185.199.108.153              assets-cdn.github.com
185.199.108.133              camo.githubusercontent.com
185.199.108.133              github.map.fastly.net
199.232.69.194               github.global.ssl.fastly.net
140.82.114.4                 gist.github.com
185.199.108.153              github.io
140.82.114.3                 github.com
140.82.114.5                 api.github.com
185.199.108.133              raw.githubusercontent.com
185.199.108.133              user-images.githubusercontent.com
185.199.108.133              favicons.githubusercontent.com
185.199.108.133              avatars5.githubusercontent.com
185.199.108.133              avatars4.githubusercontent.com
185.199.108.133              avatars3.githubusercontent.com
185.199.108.133              avatars2.githubusercontent.com
185.199.108.133              avatars1.githubusercontent.com
185.199.108.133              avatars0.githubusercontent.com
185.199.108.133              avatars.githubusercontent.com
140.82.113.10                codeload.github.com
52.217.67.220                github-cloud.s3.amazonaws.com
52.217.13.252                github-com.s3.amazonaws.com
52.217.100.148               github-production-release-asset-2e65be.s3.amazonaws.com
52.216.228.152               github-production-user-asset-6210df.s3.amazonaws.com
52.217.39.164                github-production-repository-file-5c1aeb.s3.amazonaws.com
185.199.108.153              githubstatus.com
64.71.144.202                github.community
185.199.108.133              media.githubusercontent.com

# Please Star : https://github.com/ineo6/hosts
# Mirror Repo : https://gitee.com/ineo6/hosts
# Update at: 2021-09-06 10:24:53

# GitHub Host End

手动配置hosts

macOS

hosts文件位置:/etc/hosts

macOS系统下修改需要按照如下方式:

1:首先,打开(访达)Finder。
2:使用组合键Shift+Command+G打开"前往文件夹",输入框中输入/etc/hosts
3:然后就会跳转到hosts文件位置。

注意:如果你使用VS Code,可以直接用VS Code修改和保存,不需要复制文件。

复制hosts文件到桌面上,鼠标右键右击它,选择「打开方式」—「文本编辑」,打开这个hosts文件,把前面的hosts内容复制进来。

然后把你修改好的hosts文件替换掉:/etc/hosts 文件。

注意:如果弹出密码输入框,你需要输入你当前登录账号对应的密码。

最后刷新缓存:

sudo killall -HUP mDNSResponder
Windows

hosts文件位置:C:/windows/system32/drivers/etc/hosts

将前文hosts内容追加到hosts文件,然后刷新DNS缓存:

ipconfig /flushdns

通过 SwitchHosts! 自动更新

这里推荐使用 SwitchHosts! 配置hosts,操作很简单,支持跨平台。

详细介绍可以阅读 SwitchHosts! 还能这样管理hosts,后悔没早点用

手动配置

添加一条hosts规则并启用,然后复制前文hosts内容即可。

如果你想保持和云端最新规则同步,可以用下面的配置方式。

定时同步

添加一条规则:

  • 方案名:GitHub(可以自行命名)
  • 类型:远程
  • URL 地址:https://gitee.com/ineo6/hosts/raw/master/hosts
  • 自动更新:1个小时

这样就可以和最新的hosts保持同步。

switchhost-github.png

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值