GitHub:访问慢的解决方式

简介: GitHub:访问慢的解决方式

思路

  1. 修改hosts,直接访问最快的CDN节点
  2. 通过镜像去访问


方式1: 修改hosts文件

查找GitHub域名的IP地址

我们可以利用https://www.ipaddress.com/ 来获得以下以下GitHub域名的IP地址:

github.global.ssl.fastly.net

github.com

assets-cdn.github.com

documentcloud.github.com

gist.github.com

help.github.com

nodeload.github.com

codeload.github.com

raw.github.com

status.github.com

training.github.com

avatars0.githubusercontent.com

avatars1.githubusercontent.com

avatars2.githubusercontent.com

avatars3.githubusercontent.com

打开网页后,利用输入框内分别查询以上域名后,得到相应的IP

hosts 文件中添加一下配置

hosts 文件路径

mac: /etc/hosts

win: C:\WINDOWS\system32\drivers\etc\hosts

# GitHub Start
140.82.113.4      github.com
140.82.114.4      github.com
140.82.113.4      gist.github.com
140.82.113.6      api.github.com
185.199.108.153   assets-cdn.github.com
185.199.109.153   assets-cdn.github.com
185.199.110.153   assets-cdn.github.com
185.199.111.153   assets-cdn.github.com
199.232.96.133    raw.githubusercontent.com
199.232.96.133    gist.githubusercontent.com
199.232.96.133    cloud.githubusercontent.com
199.232.96.133    camo.githubusercontent.com
199.232.96.133    avatars.githubusercontent.com
199.232.96.133    avatars0.githubusercontent.com
199.232.96.133    avatars1.githubusercontent.com
199.232.96.133    avatars2.githubusercontent.com
199.232.96.133    avatars3.githubusercontent.com
199.232.96.133    avatars4.githubusercontent.com
199.232.96.133    avatars5.githubusercontent.com
199.232.96.133    avatars6.githubusercontent.com
199.232.96.133    avatars7.githubusercontent.com
199.232.96.133    avatars8.githubusercontent.com
199.232.96.133    user-images.githubusercontent.com
# GitHub End


刷新 DNS 存**

在终端或CMD中,执行以下命令:

ipconfig /flushdns


备注

https://gitee.com/bryan31/githubhost

自动选取并生成github最快CDN IP的小工具,生成后贴到hosts文件即可


方式2: 镜像方式

https://gitclone.com/

https://hub.fastgit.org


参考链接:

https://segmentfault.com/a/1190000023735638

https://www.jianshu.com/p/0493dcc15d6f



相关文章
|
8月前
|
网络安全 开发工具 git
解决 Git 访问 GitHub 时的 SSL 错误
通过上述步骤,可以有效解决 Git 访问 GitHub 时的 SSL 错误。推荐优先更新 CA 证书和正确配置 Git 使用 CA 证书,避免禁用 SSL 验证。如果问题持续,可以切换到 SSH 方式访问 GitHub,确保连接的安全性和稳定性。希望这些内容对您的学习和工作有所帮助。
2425 4
如何访问GitHub快的飞起?两步解决访问超时GitHub,无法访问GitHub的问题
这篇文章提供了几种方法来解决访问GitHub时速度慢或超时的问题,包括使用代理服务器、下载加速工具,以及考虑使用国内代码管理网站如码云(gitee)来加速下载GitHub上的资源。
如何访问GitHub快的飞起?两步解决访问超时GitHub,无法访问GitHub的问题
|
Windows
github图床链接打开提示raw.githubusercontent.com无法访问解决
picgo上传图片不显示,到GitHub打开也不显示图片,粘贴链接访问提示“raw.githubusercontent.com无法访问”,百度搜索后修改了下hosts解决了。
1146 2
github图床链接打开提示raw.githubusercontent.com无法访问解决
|
存储 安全 API
GitHub主要仓库泄露访问令牌,代码与云环境面临风险
GitHub主要仓库泄露访问令牌,代码与云环境面临风险
GitHub主要仓库泄露访问令牌,代码与云环境面临风险
|
Web App开发 Linux 开发工具
告别卡顿,畅享GitHub:国内开发者必看的五大加速访问与下载技巧
【8月更文挑战第4天】告别卡顿,畅享GitHub:国内开发者必看的五大加速访问与下载技巧
告别卡顿,畅享GitHub:国内开发者必看的五大加速访问与下载技巧
|
网络协议 开发工具 git
hexo github部署,通过域名访问你的博客
本文介绍了如何使用Hexo命令部署博客到GitHub,并详细说明了如何通过自定义域名访问GitHub上部署的博客。
hexo github部署,通过域名访问你的博客
|
12月前
|
Windows
github图床链接打开提示raw.githubusercontent.com无法访问解决
github图床链接打开提示raw.githubusercontent.com无法访问解决
314 0
|
存储 安全 API
GitHub代码删了也无用,任何人仍可永久访问?!微软:这不是Bug而是有意设计...
开源安全公司Truffle Security发现,GitHub上的数据删除可能只是表面现象,实际上被删的数据仍可被访问。这一发现震惊了开源社区。研究人员引入了“跨分叉对象引用”(CFOR)这一概念,描述了如何通过已删除或私有fork访问敏感数据。即便存储库被删除,提交的数据仍可通过fork存取,甚至私有存储库的数据也可能被公开访问。尽管GitHub回应称这是有意为之的设计,但对于许多用户来说,这打破了对数据隐私的基本期望。此发现不仅影响GitHub用户,还可能波及其他版本控制系统。
386 4
github无法访问?vscode 无法使用github登录同步? 改 hosts 吧
github无法访问?vscode 无法使用github登录同步? 改 hosts 吧
github无法访问或速度慢的问题几个解决方案总结
github无法访问或速度慢的问题几个解决方案总结
1149 0

热门文章

最新文章