在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

相关推荐
CoderJia程序员甲38 分钟前
GitHub 热榜项目 - 日榜(2025-12-16)
llm·github·ai教程
bj_zhb1 小时前
Git 回退到某个 commit
git·github
openinstall全渠道统计1 小时前
开发者指南:广告投放系统搭建与前后端数据打通全流程
windows·git·oracle·eclipse·sqlite·github
测试人社区-小明2 小时前
测试领域的“云原生”进化:Serverless Testing
人工智能·科技·云原生·面试·金融·serverless·github
阿里嘎多学长2 小时前
2025-12-15 GitHub 热点项目精选
开发语言·程序员·github·代码托管
周杰伦_Jay14 小时前
【大模型数据标注】核心技术与优秀开源框架
人工智能·机器学习·eureka·开源·github
吴敬悦16 小时前
私有的 GitHub Package 怎么拉取?
npm·github
小胖霞20 小时前
全栈系列(15)github Actions自动化部署前端vue
前端·node.js·github
Leinwin20 小时前
Microsoft 365 Copilot:更“懂你”的AI助手
人工智能·microsoft·copilot
CoderJia程序员甲21 小时前
GitHub 热榜项目 - 日榜(2025-12-15)
git·ai·开源·llm·github