在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

相关推荐
hanqunfeng1 天前
GitHub Actions Workflow 详细指南
github
haluhalu.1 天前
prompts.chat:03-core-prompting-principles
prompt·github
daad7771 天前
记录vscode连接matlab启动环境搭建
java·vscode·matlab
阿里嘎多学长2 天前
2026-07-10 GitHub 热点项目精选
开发语言·程序员·github·代码托管
Luoxi_82 天前
Anaconda超详细的安装教程+VScode的使用
ide·vscode·编辑器
今夕资源网2 天前
AI声音克隆软件 CosyVoice今夕一键整合包解压即用 阿里巴巴通义实验室开源 github斩获22K星标
人工智能·github·多国语言·声音克隆·零样本语音克隆·感情·ai语音克隆
无糖冰可乐212 天前
安装wsl2,并链接Windows上的vscode运行项目
pytorch·vscode·python·pip
ShallWeL2 天前
Cursor、Copilot、Claude Code 怎么选
人工智能·copilot·ai编程·agi·ai-native
胡萝卜术2 天前
从聊天模型到本地执行助手:Remote MCP 多工具 Agent 实战
面试·架构·github
慕容引刀2 天前
告别Commit信息纠结:使用Git AI Commit插件实现规范化提交
人工智能·git·github·visual studio code·visual studio