共计 1295 个字符,预计需要花费 4 分钟才能阅读完成。
众所周知 GitHub 服务器的连通性都不太好,于是我们可以指定 ip,达到稳定的效果。
非常简单,只需要:修改 /etc/hosts 文件,加上 GitHub 网站的 IP 地址就可以。
步骤 1、打开 host 文件
sudo vi /etc/hosts
步骤 2、加入 ip 地址
# GitHub Start
192.30.253.112 github.com
192.30.253.119 gist.github.com
199.232.28.133 assets-cdn.github.com
199.232.28.133 raw.githubusercontent.com
199.232.28.133 gist.githubusercontent.com
199.232.28.133 cloud.githubusercontent.com
199.232.28.133 camo.githubusercontent.com
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 avatars4.githubusercontent.com
199.232.28.133 avatars5.githubusercontent.com
199.232.28.133 avatars6.githubusercontent.com
199.232.28.133 avatars7.githubusercontent.com
199.232.28.133 avatars8.githubusercontent.com
185.199.110.154 github.githubassets.com
# GitHub End
然后就 OK 了,看看是否能正常连接 GitHub。
补充
这是最新找的一份 Github ip 地址。 文章来源:https://www.toymoban.com/diary/problem/595.html
如果 ip 失效了,可以在去【githubusercontent.com.ipaddress.com/raw.githubusercontent.com】,找到 ip 替换即可。 文章来源地址 https://www.toymoban.com/diary/problem/595.html
到此这篇关于解决 Linux 访问不了 GitHub 问题只需要配置 host,Linux 无法访问 github 解决方案的文章就介绍到这了, 更多相关内容可以在右上角搜索或继续浏览下面的相关文章,希望大家以后多多支持 TOY 模板网!
原文地址:https://www.toymoban.com/diary/problem/595.html
如若转载,请注明出处:如若内容造成侵权 / 违法违规 / 事实不符,请联系站长进行投诉反馈,一经查实,立即删除!
正文完