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

Windows下GitHub Enterprise每次认证均弹出登录窗口问题求助

解决GitHub Enterprise HTTPS交互反复弹出登录窗口的问题

以下是针对你遇到的反复弹出「Connect to GitHub」登录窗口问题的排查和解决步骤:

1. 升级Git Credential Manager (GCM)

你当前使用的Git版本自带的GCM可能存在对GitHub Enterprise SSO支持的旧版本兼容问题,建议更新到最新版:

  • 直接更新Git到最新稳定版:执行命令 git update-git-for-windows,新版Git会集成最新的GCM
  • 或单独配置新版GCM:执行 git config --global credential.helper manager-core,然后运行 git credential-manager-core configure 完成配置

2. 为GitHub Enterprise配置专属SSO凭据规则

添加Git全局配置,让GCM明确识别你的企业组织并复用SSO凭据:

# 针对GitHub Enterprise启用SSO支持
git config --global credential.https://github.com.ssoEnabled true
# 指定企业组织的SSO账户(替换为你的实际账户名)
git config --global credential.https://github.com.ssoAccount FirstName-LastName_organisation
# 确保GCM使用正确的认证权限
git config --global credential.https://github.com.authority "GitHub Enterprise Cloud"

3. 彻底清除旧凭据并重新初始化SSO

  • 打开Windows凭据管理器,删除所有与git:https://github.com相关的条目
  • 在Git Bash中执行命令清除GCM缓存的凭据:
    git credential-manager-core erase
    
    执行后会提示输入服务器地址,输入 https://github.com 并回车确认清除
  • 重新访问https://github.com/enterprises/my-org/sso完成SSO登录,此时Windows凭据管理器会重新生成正确的凭据

4. 检查Git配置中的关键设置

  • 你的配置中http.sslverify=false存在安全风险,建议恢复为true(若因企业证书问题需要关闭,确保已正确配置http.sslcainfo指向企业根证书)
  • 确认credential.helper已设置为manager-core(新版GCM),而非旧版的manager

5. 确认浏览器SSO会话有效性

确保默认浏览器中已保持GitHub Enterprise的登录状态,且SSO认证未过期:

  • 打开https://github.com/enterprises/my-org,确认右上角显示你的组织账户
  • 若会话过期,重新完成SSO登录后再测试Git操作

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.12 11:13:26