You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

无法在GitHub Desktop与VS Code中登录GitHub账号求助

解决GitHub Desktop/VS Code登录GitHub时加载不跳转的问题

1. 手动使用个人访问令牌(PAT)登录

  • 生成PAT:在GitHub账号的Settings > Developer settings > Personal access tokens中创建,勾选repo、user、gist等必要权限,生成后复制令牌
  • VS Code登录:打开命令面板(Ctrl+Shift+P),输入GitHub: Sign in with Token,粘贴令牌完成认证
  • GitHub Desktop登录:在登录界面选择「Use a token」选项,粘贴令牌完成登录

2. 重置应用认证缓存

  • VS Code操作:
    1. 完全关闭VS Code
    2. 删除对应路径的缓存文件夹:
      • Windows: %APPDATA%\Code\Cache、%APPDATA%\Code\Caches
      • macOS: ~/Library/Caches/Code
      • Linux: ~/.config/Code/Cache、~/.config/Code/Caches
  • GitHub Desktop操作:
    1. 完全关闭GitHub Desktop
    2. 删除认证存储文件:
      • Windows: %APPDATA%\GitHub Desktop\storage.json
      • macOS: ~/Library/Application Support/GitHub Desktop/storage.json
      • Linux: ~/.config/GitHub Desktop/storage.json

3. 确认系统默认浏览器可用性

  • 确保默认浏览器能正常访问GitHub官网,且已设置为系统默认:
    • Windows: 进入「设置 > 应用 > 默认应用」,指定常用浏览器为默认
    • macOS: 进入「系统设置 > 桌面与 Dock > 默认网页浏览器」,选择对应浏览器
    • Linux: 根据桌面环境(GNOME/KDE等)在系统设置中修改默认浏览器

4. 重置Git代理配置

  • 打开终端/命令提示符,执行命令清除全局代理:
    git config --global --unset http.proxy
    git config --global --unset https.proxy
    
  • 若需使用代理,可重新配置(替换为你的代理地址和端口):
    git config --global http.proxy http://127.0.0.1:你的代理端口
    git config --global https.proxy http://127.0.0.1:你的代理端口
    

5. 修复应用权限问题

  • Windows:右键应用图标,选择「以管理员身份运行」后尝试登录
  • macOS:进入「系统设置 > 隐私与安全性」,确认应用已获得「完全磁盘访问」权限
  • Linux:执行命令修复应用目录权限:
    sudo chown -R $USER:$USER ~/.config/GitHub Desktop
    sudo chown -R $USER:$USER ~/.config/Code
    

内容的提问来源于stack exchange,提问作者user23490293

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.29 09:07:07