首页 > 编程知识 正文

GitHub无法访问此页面

时间:2023-11-20 14:01:34 阅读:290210 作者:DMOJ

GitHub是一个十分重要的代码托管平台,但有时候我们会遇到“无法访问此页面”的情况。下面我们将从多个方面来阐述这个问题。


修改HOSTS

# GitHub520 Host Start
140.82.114.25                 alive.github.com
140.82.113.5                  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.22                 central.github.com
185.199.111.133               cloud.githubusercontent.com
140.82.114.9                  codeload.github.com
140.82.113.22                 collector.github.com
185.199.111.133               desktop.githubusercontent.com
185.199.111.133               favicons.githubusercontent.com
140.82.112.3                  gist.github.com
52.216.163.147                github-cloud.s3.amazonaws.com
52.217.124.1                  github-com.s3.amazonaws.com
52.216.144.83                 github-production-release-asset-2e65be.s3.amazonaws.com
52.217.121.249                github-production-repository-file-5c1aeb.s3.amazonaws.com
54.231.137.153                github-production-user-asset-6210df.s3.amazonaws.com
192.0.66.2                    github.blog
140.82.114.4                  github.com
140.82.114.17                 github.community
185.199.110.154               github.githubassets.com
151.101.1.194                 github.global.ssl.fastly.net
185.199.110.153               github.io
185.199.111.133               github.map.fastly.net
185.199.110.153               githubstatus.com
140.82.112.25                 live.github.com
185.199.111.133               media.githubusercontent.com
185.199.111.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.253.40                 vscode.dev
140.82.112.21                 education.github.com


# Update time: 2023-08-02T18:52:33+08:00
# Update url: https://raw.hellogithub.com/hosts
# Star me: https://github.com/521xueweihan/GitHub520
# GitHub520 Host End

一、网络问题

一些GitHub无法访问此页面的问题可能来自你的网络,包括网络连接问题、DNS解析问题等。

首先,我们需要确保网络连接是正常的。尝试连接其他网站或者使用其他设备连接同一个网络查看是否能够访问GitHub。如果无法访问,你需要检查你的网络连接,并且重启路由器、调整代理设置等。

其次,DNS解析也可能影响你的GitHub访问。你可以尝试更换DNS服务器,比如使用谷歌的公共DNS服务器(8.8.8.8)或者阿里云的DNS服务器(223.5.5.5),或者通过hosts文件显式指定访问地址。

二、身份认证问题

GitHub平台需要进行身份认证才能访问私人仓库。如果你没有正确的身份认证,将会被提示无法访问页面。

首先,你需要确认你的账户是确实有访问权限的。如果你被邀请访问私人仓库,需要接受邀请才能访问,如果账户没有被邀请,你将无法访问私人仓库。

其次,你需要确认你的访问身份是正确的。如果你尝试使用错误的账户访问私人仓库或者使用了未授权的token进行访问,你将被拒绝访问GitHub页面。

如果你确定账户和访问身份都是正确的,但还是无法访问GitHub页面,你可以尝试重新进行身份认证,或者申请新的访问token。

三、防火墙问题

另一个可能导致GitHub无法访问此页面的原因是防火墙问题。

首先,你需要检查你的本地防火墙设置,确保没有设置过于严格的规则。例如,如果你设置了所有出站都需要经过严格的规则过滤,那么GitHub可能被阻止访问。

其次,企业网络通常会使用设备或软件来过滤网络访问。如果你使用的是企业网络,你需要联系网络管理员确认是否设置了网络过滤规则,并且排除是否由于规则过于严格导致了访问问题。

四、代理问题

有些GitHub无法访问此页面的问题可能来自于你的代理设置。

首先,你需要将代理设置正确,包括代理地址、端口号、代理类型等。请注意如果你在使用代理服务器,请选择支持HTTP、HTTPS、Git协议访问的代理服务器。

其次,你需要确认你的代理服务器是否正常运行。如果你使用的是自建代理服务器,你需要确认代理服务器的可用性。如果你使用的是公共代理服务器,建议将代理地址更新为最新的可用代理服务器地址。

五、错误网址

最后,一些GitHub无法访问此页面的问题可能仅仅是因为你输入了错误的网址。请仔细检查输入的地址是否正确,特别是当你尝试手动输入URL时。GitHub的URL必须是完整的,包括用户名、仓库名、分支等信息。

示例代码:

git clone https://github.com/username/repository.git
git clone https://github.com/username/repository.git --branch branchname

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。