【问题标题】:(GCMC - windows) git credential manager core keeps prompting for password (gitlab repo)(GCMC - windows) git credential manager core 不断提示输入密码 (gitlab repo)
【发布时间】:2020-12-08 13:33:42
【问题描述】:

在更改我的 gitlab 帐户密码后,我在设置凭据助手时遇到了麻烦。 我卸载了我以前的 git for windows 版本并安装了最新版本,包括 Git Credential Manager Core。

我正在使用 Android Studio 并设法通过 IDE 获取/拉取/推送。由于我为 Windows 安装了这个新版本的 git,所以不时出现提示。更糟糕的是,有时当我执行 git 操作时,我的帐户由于公司政策而被阻止(我猜是在多次调用错误密码之后)。

我尝试将我的凭据助手设置为managermanager-core,但没有成功。我曾经在 Windows 身份验证管理器中添加条目,但它们被从中删除,不知道是谁。

我的远程仓库设置了一个 https URL。

所以我的问题是:如何设置 GCMC 在我的密码过期时询问我的密码并缓存我提供的新密码?

我对 GCMC 有点不满,但找不到答案,这太疯狂了,新东西实际上比今天已弃用的旧工具更复杂和错误(例如,与 wincred 一起工作得很好)。

【问题讨论】:

  • 我在这里遇到同样的问题,我的凭据每天都会丢失......这很烦人

标签: git


【解决方案1】:

我最终使用了访问令牌。我做了一个小文档(法语,抱歉)。

上下文

Depuis la version v2.29.0,git for windows préconise l'utilisation de GCMC - Git Credential Manager Core - en remplacement de "Git Credential Manager"(已弃用):

重要提示:v2.29.0 和 v2.29.1 将 Git Credential Manager for Windows(刚刚弃用)的现有用户升级到 Git Credential Manager Core(“GCM Core”,它是前者的指定继任者)。这是必要的,因为 GitHub 已弃用基于密码的身份验证,并打算很快取消对它的支持,而 GCM Core 已为此更改做好准备。”

安装

  1. Dans les étapes d'installation de git for Windows, sélectionner Git Credential Manager Core

配置

  1. Une fois l'installation effectuée, ouvrir un bash git et valider que la commande git config credential.helper retourne bien manager-core
  2. Se rendre dans le gestionnaire d'identification Windows et supprimer les éventuelles entrées existantes vers git:https://git.xxxx
  3. Dans les settings gitlab, générer un access token (name : personal access token)
  4. Dans le répertoire d'un projet clôné depuis git, réaliser un git pull / fetch / push
  5. Une modale s'ouvre, renseigner alors en login : personal access token, password : le token nouvellement créé
  6. Valider l'ajout de la nouvelle entrée dans le gestionnaire d'identification Windows avec comme login personal access token
  7. Si votre IDE (testé avec IntelliJ / Android Studio) 要求验证,cocher Use credential manager

调试

En cas de problème et pour activer le debug ouvrir une invite de commande et taper :

setx GIT_TRACE %userprofile%\git.log
setx GCM_TRACE %userprofile%\git.log
setx GCM_TRACE_SECRETS 1 (attention, des informations sensibles seront visibles dans le log - access token -)

通过 git bash / IDE un fichier git.log devrait donc être présent dans votre répertoire %userprofile% (ce n'est pas instantané) 使用后

日志外:

[RunAsync] Tracing of secrets is enabled. Trace output may contain sensitive information.
[RunInternalAsync] Git Credential Manager version X (Windows, .NET Framework X) 'store'
[ExecuteAsync] Start 'store' command...
[ExecuteAsync] Detecting host provider for input:
[ExecuteAsync]  protocol=https
[ExecuteAsync]  host=git.xxxx
[ExecuteAsync]  username=personal access token
[ExecuteAsync]  password=XXXXXXXXXXXXXXXXXXXXX  <-------- votre access token
[GetProvider] Performing auto-detection of host provider.
[ExecuteAsync] Host provider 'Generic' was selected.
[StoreCredentialAsync] Storing credential with service=https://git.xxxx account=personal access token...
[StoreCredentialAsync] Credential was successfully stored.
[ExecuteAsync] End 'store' command...

Pour désactiver le debug : supprimer les variables d'environnement GIT_TRACE, GCM_TRACE, GCM_TRACE_SECRETS

【讨论】:

    【解决方案2】:

    四月。 2022:latest GCM v2.0.692 正式支持 GitLab GUI 提示符。

    PR 621:

    在所有平台上添加 GUI 提示以进行 GitLab 身份验证。需要 GUI 提示,因为如果从没有终端的 IDE 调用 GCM/Git,则用户无法对 GitLab 进行身份验证。

    【讨论】:

      猜你喜欢
      • 2023-02-16
      • 1970-01-01
      • 2021-06-21
      • 2013-09-01
      • 2017-07-26
      • 1970-01-01
      • 2017-09-30
      • 1970-01-01
      • 2021-07-20
      相关资源
      最近更新 更多