在vscode(idea)使用GitHub账号、Copilot异常

在idea使用GitHub账号、Copilot异常

登录GitHub显示

c 复制代码
Invalid authentication data.Connection refused: connect

或者副驾驶显示

c 复制代码
Failed to initiate the GitHub login process. Please try again.

一般网上的方法推荐使用token登录,或者降级副驾驶

经过研究,其实就是DNS污染

修改hosts(C:\Windows\System32\drivers\etc\hosts),添加以下参数。ipaddress.com可以最新查询地址
一定要添加api.github.com
必须添加api.github.com的ip

c 复制代码
# Github
140.82.114.3 github.com
199.232.69.194 github.global.ssl.fastly.net
140.82.114.5 api.github.com

之后cmd登陆

c 复制代码
ipconfig /flushdns

当浏览器可以裸连github.com,表示dns刷新成功,这样所有问题都解决了。

host设置

其中hosts 设置详细可以参看
https://github.com/521xueweihan/GitHub520

相关推荐
独立开阀者_FwtCoder35 分钟前
【Augment】 Augment技巧之 Rewrite Prompt(重写提示) 有神奇的魔法
前端·javascript·github
我在看世界1 小时前
家里vscode连公司内网vscede
vscode·ssh
极客悟道3 小时前
巧解 Docker 镜像拉取难题:无需梯子和服务器,拉取数量无限制
后端·github
独立开阀者_FwtCoder3 小时前
你用 Cursor 写公司的代码安全吗?
前端·javascript·github
悠悠小茉莉4 小时前
Win11 安装 Visual Studio(保姆教程 - 更新至2025.07)
c++·ide·vscode·python·visualstudio·visual studio
T__TIII5 小时前
Dify 自定义插件
人工智能·github
SZ1701102315 小时前
华为云 银河麒麟 vscode远程连接
ide·vscode·华为云
yanjiee6 小时前
需要scl来指定编译器的clangd+cmake在vscode/cursor开发环境下的配置
ide·vscode·编辑器
小皮侠9 小时前
nginx的使用
java·运维·服务器·前端·git·nginx·github
汪汪队睡大觉759 小时前
OpenAI-Kotlin文档详解
github