在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

相关推荐
一个程序猿老马11 小时前
012、远程协作:连接GitHub/Gitee与git remote
git·gitee·github
小柯博客14 小时前
STM32MP2安全启动技术深度解析
c语言·c++·stm32·嵌入式硬件·安全·开源·github
zhensherlock14 小时前
Protocol Launcher 系列:Tally 快速计数器的深度集成
前端·javascript·typescript·node.js·自动化·github·js
L-影15 小时前
vscode安装SQLAlchemy步骤
ide·vscode·编辑器
无限进步_17 小时前
C++ 继承机制完全解析:从基础原理到菱形继承问题
java·开发语言·数据结构·c++·vscode·后端·算法
Hy行者勇哥21 小时前
国内外与vscode类似的软件有哪些?国内那些软件可以平替?
ide·vscode·编辑器
darkb1rd1 天前
OpenMythos:从零重构大模型架构实战指南
开源·github·好物分享
π同学1 天前
ESP-IDF+vscode开发ESP32第八讲——音频信号全解
vscode·esp32·i2s·音频信号
Captain_Data1 天前
2026年AI编程工具终极横评:Cursor vs Claude Code vs Copilot
copilot·ai编程·claude·cursor·github copilot
弑神风1 天前
GitHub Copilot vs Cursor深度横评(2026):谁是AI编程之王?
程序员·github·copilot·ai编程·cursor·工具测评