Github 访问慢解决方案

Github 访问慢解决方案

温馨提示:本文最后更新于2024-12-18 14:11:25,某些文章具有时效性,若有错误或已失效,请在下方留言

修改 host 文件

host 文件位置

host 文件在每个系统上的位置不一样

    • WindowsC:\Windows\System32\drivers\etc\hosts

    • Linux/etc/hosts

    • macOS/etc/hosts

windows 使用记事本打开,Linux 以及 macOS 使用以下的命令打开。

sudo vim /etc/hosts

修改 host

host 最新的代码链接:https://raw.hellogithub.com/hosts,可以从链接中获取最新 host 配置。如果需要自动更新,可以使用 SwitchHosts 工具。

# GitHub520 Host Start
140.82.114.26                 alive.github.com
140.82.113.6                  api.github.com
185.199.110.153               assets-cdn.github.com
185.199.111.133               avatars.githubusercontent.com
185.199.111.133               avatars0.githubusercontent.com
185.199.111.133               avatars1.githubusercontent.com
185.199.111.133               avatars2.githubusercontent.com
185.199.111.133               avatars3.githubusercontent.com
185.199.111.133               avatars4.githubusercontent.com
185.199.111.133               avatars5.githubusercontent.com
185.199.111.133               camo.githubusercontent.com
140.82.112.21                 central.github.com
185.199.111.133               cloud.githubusercontent.com
140.82.113.10                 codeload.github.com
140.82.114.21                 collector.github.com
185.199.108.133               desktop.githubusercontent.com
185.199.111.133               favicons.githubusercontent.com
140.82.112.3                  gist.github.com
3.5.30.3                      github-cloud.s3.amazonaws.com
54.231.196.137                github-com.s3.amazonaws.com
52.217.194.73                 github-production-release-asset-2e65be.s3.amazonaws.com
3.5.16.186                    github-production-repository-file-5c1aeb.s3.amazonaws.com
3.5.25.97                     github-production-user-asset-6210df.s3.amazonaws.com
192.0.66.2                    github.blog
140.82.112.3                  github.com
140.82.113.17                 github.community
185.199.109.154               github.githubassets.com
151.101.193.194               github.global.ssl.fastly.net
185.199.109.153               github.io
185.199.111.133               github.map.fastly.net
185.199.109.153               githubstatus.com
140.82.113.25                 live.github.com
185.199.111.133               media.githubusercontent.com
185.199.108.133               objects.githubusercontent.com
13.107.42.16                  pipelines.actions.githubusercontent.com
185.199.111.133               raw.githubusercontent.com
185.199.111.133               user-images.githubusercontent.com
13.107.246.51                 vscode.dev
140.82.113.21                 education.github.com
185.199.108.133               private-user-images.githubusercontent.com


# Update time: 2024-11-06T02:53:20+08:00
# Update url: https://raw.hellogithub.com/hosts
# Star me: https://github.com/521xueweihan/GitHub520
# GitHub520 Host End

将上边的内容添加到 hosts 文件。

刷新 DNS

Windows 在 CMD 窗口输入

ipconfig /flushdns

Linux 以 Centos 系统为例,命令行输入

systemctl restart NetworkManager

macOS 在终端输入

sudo killall -HUP mDNSResponder

上述方法无效可以尝试重启机器。

使用Github镜像或加速网站

最常用的镜像地址

https://gitclone.com/ (此镜像是直接搜索相关仓库,然后克隆)
https://ghproxy.com/ (GitHub 文件 , Releases , archive , gist , raw.githubusercontent.com 文件代理加速下载服务)
https://toolwa.com/github/ (GitHub 加速下载)
https://ghproxy.qystudio.ml/
https://ghdl.feizhuqwq.cf/
https://pd.zwc365.com/
https://gh.api.99988866.xyz/

参考

GitHub访问不了或者很慢的解决办法

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容