github无法访问?vscode 无法使用github登录同步? 改 hosts 吧

Unable to resolve resource vscode-vfs://github%2B7b2276223a312c22726566223a7一、无法访问 github.com ?

想要去 github.com 上拿来主义,结果访问不了,或者 npm 时一直失败?

GitHub: Let's build from here · GitHubGitHub is where over 100 million developers shape the future of software, together. Contribute to the open source community, manage your Git repositories, review code like a pro, track bugs and features, power your CI/CD and DevOps workflows, and secure code before you commit it.https://www.ipaddress.com/site/github.com

是什么原因不用问,直接使用   https://www.ipaddress.com/ 查询到 github.com 的当前 ip 地址,

 或

 

140.82.114.4 | 140.82.112.4

在你电脑的 hosts 文件内添加 (hosts文件路径应该是:C:\Windows\System32\drivers\etc\hosts)

140.82.114.4 github.com 
140.82.112.4 github.com

注意,这个Ip地址有可能发生变化,所以访问不了的时候,再去查一次 ip 重新添加一下

二、无法使用 github.com 的帐号登录并同步 vscode ?

一样,先要去 https://www.ipaddress.com/ 查询到 vscode-auth.github.com 对应到的 ip ,我查询到了 4个,

同样添加到  hosts 内

最后你的 hosts 文件内应该看起来是这个样子

这样,你应该就可以用浏览器访问 github.com 并且 vscode 也可以使用 github 帐号登录了

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐