Github访问慢修改hosts一招搞定

4,261次阅读
没有评论

共计 2510 个字符,预计需要花费 7 分钟才能阅读完成。

前言

Github 近期访问很慢,而且阶段性的无法访问,网上长篇大论找了 n 个方法都不行,最后通过修改 hosts 直接起飞,话不多说,直接开搞,实测 2021/7/14 可用,近期更新镜像站使用,实测时间 2021/9/26

hosts


# GitHub Host Start
185.199.108.154              github.githubassets.com
140.82.112.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.113.3                 gist.github.com
140.82.113.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.112.10                codeload.github.com
52.217.131.169               github-cloud.s3.amazonaws.com
52.216.104.43                github-com.s3.amazonaws.com
52.217.110.196               github-production-release-asset-2e65be.s3.amazonaws.com
52.217.128.1                 github-production-user-asset-6210df.s3.amazonaws.com
52.217.137.41                github-production-repository-file-5c1aeb.s3.amazonaws.com
185.199.108.133              media.githubusercontent.com

使用方法

win10/win7

打开我的电脑 – C:\WINDOWS\system32\drivers\etc  找到 hosts 文件,通过记事本或其他的文本工具打开,放入以上的 hosts 即可

macOS

打开访达 – 顶部菜单  – 前往 – 前往文件夹 输入:/etc  即可看到 hosts 文件,可以复制出来,用编辑器放入以上的 hosts,覆盖即可

linux

进入 ssh,输入:vim /etc/hostsvi /etc/hosts  放入以上 hosts 即可

镜像站

可选择反向代理的镜像站拉取文件,经过一段时间的使用,发现 hosts 也不是很稳定,每次比较着急访问的时候还是不可以,通过反向代理还不错,为维持站长长期维护,可通过镜像站进行打赏。

支持终端命令行 git clone , wget , curl 等工具下载 支持 raw.githubusercontent.com , gist.github.com , gist.githubusercontent.com 文件下载

镜像站地址:https://mirror.ghproxy.com/

使用方法

https://mirror.ghproxy.com/https://github.com

终端使用方法

git clone

git clone https://mirror.ghproxy.com/ https://github.com/stilleshan/ServerStatus
wget & curl

wget https://mirror.ghproxy.com/ https://github.com/stilleshan/ServerStatus/archive/master.zip
wget https://mirror.ghproxy.com/ https://raw.githubusercontent.com/stilleshan/ServerStatus/master/Dockerfile
curl -O https://mirror.ghproxy.com/ https://github.com/stilleshan/ServerStatus/archive/master.zip
curl -O https://mirror.ghproxy.com/ https://raw.githubusercontent.com/stilleshan/ServerStatus/master/Dockerfile
正文完
 
zyx
版权声明:本站原创文章,由 zyx 2021-07-14发表,共计2510字。
转载说明:所有文章未经授权禁止转载、摘编、复制或建立镜像
评论(没有评论)