首页 > 解决方案 > (GCMC - windows) git credential manager core 不断提示输入密码 (gitlab repo)

问题描述

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

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

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

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

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

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

标签: git

解决方案


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

语境

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" (deprecated):

重要提示: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électionnerGit Credential Manager Core

配置

  1. Une fois l'installation effectuée, ouvrir un bash git et valider que la commande git config credential.helperretourne bienmanager-core
  2. Se rendre dans le gestionnaire d'identification Windows et supprimer les éventuelles entrées existantes versgit: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 ungit 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 loginpersonal access token
  7. Si votre IDE (testé avec IntelliJ / Android Studio) 要求 une authentification, cocherUse 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 -)

Après 通过 git bash / IDE un fichier git.logdevrait 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


推荐阅读