简体   繁体   English

Git - 缓慢获取 - 凭证管理器主机提供程序

[英]Git - slow fetch - credential manager host providers

I have noticed that git operations slowed down recently, it might be related to the upgrade of git and using credential-manager-core instead of credential-manager, I've tried to diagnose the issue using GCM_TRACE=1 git fetch , looks like I might have messed up my configuration: I have noticed that git operations slowed down recently, it might be related to the upgrade of git and using credential-manager-core instead of credential-manager, I've tried to diagnose the issue using GCM_TRACE=1 git fetch , looks like I可能弄乱了我的配置:

[GetProviderAsync] Checking against 3 host providers registered with priority 'Normal'.

My colleague does not see such line and only one host provider is checked.我的同事没有看到这样的行,并且只检查了一个主机提供商。 How can I change the configuration of host providers used by git credential manager?如何更改 git 凭据管理器使用的主机提供程序的配置?

Update: Using a portable version of git did not help, trace output below:更新:使用便携式版本的 git 没有帮助,请在下面跟踪 output:

[RunInternalAsync] Version: 2.0.394.50751
[RunInternalAsync] Runtime: .NET Framework 4.0.30319.42000
[RunInternalAsync] Platform: Windows (x86-64)
[RunInternalAsync] AppPath: git-credential-manager-core
[RunInternalAsync] Arguments: get
[ExecuteAsync] Start 'get' command...
[ExecuteAsync] Detecting host provider for input:
[ExecuteAsync]   protocol=https
[ExecuteAsync]   host=dev.azure.com
[ExecuteAsync]   path=........
[ExecuteAsync]   username=........
[GetProviderAsync] Performing auto-detection of host provider.
[GetProviderAsync] Checking against 3 host providers registered with priority 'Normal'.
[ExecuteAsync] Host provider 'Azure Repos' was selected.
[GetCredentialAsync] Looking for existing credential in store with service=https://........ account=...
[GetCredentialAsync] Existing credential found.
[ExecuteAsync] End 'get' command...
[RunInternalAsync] Version: 2.0.394.50751
[RunInternalAsync] Runtime: .NET Framework 4.0.30319.42000
[RunInternalAsync] Platform: Windows (x86-64)
[RunInternalAsync] AppPath: git-credential-manager-core
[RunInternalAsync] Arguments: store
[ExecuteAsync] Start 'store' command...
[ExecuteAsync] Detecting host provider for input:
[ExecuteAsync]   protocol=https
[ExecuteAsync]   host=........
[ExecuteAsync]   path=................
[ExecuteAsync]   username=..............
[ExecuteAsync]   password=********
[GetProviderAsync] Performing auto-detection of host provider.
[GetProviderAsync] Checking against 3 host providers registered with priority 'Normal'.
[ExecuteAsync] Host provider 'Azure Repos' was selected.
[StoreCredentialAsync] Storing credential with service=............. account=...............
[StoreCredentialAsync] Credential was successfully stored.
[ExecuteAsync] End 'store' command...

Number of registered host providers seems suspicious but I do not know how it can be changed.注册主机提供商的数量似乎很可疑,但我不知道如何更改。 Also - storing credentials on each fetch does not seem like an efficient thing to do.此外 - 在每次提取时存储凭据似乎不是一件有效的事情。

Update 2: Switching to SSH authorization did not help much, so the root cause of delays is not related to GCM.更新 2:切换到 SSH 授权并没有太大帮助,因此延迟的根本原因与 GCM 无关。 I'll investiage a bit more and probably close the question.我会进行更多调查,可能会结束这个问题。

Test if this is linked to your current Git for Windows installation by:通过以下方式测试这是否链接到您当前的 Git 以进行 Windows安装:

set PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\
set GH=C:\path\to\git
set PATH=%GH%\bin;%GH%\usr\bin;%GH%\mingw64\bin;%GH%\mingw64\libexec\git-core;%PATH%
  • checking if the issue persists on git fetch检查git fetch问题是否仍然存在

That way, you don't disturb your current setup, and limit your tests to a single CMD session.这样,您就不会干扰您当前的设置,并将您的测试限制在单个 CMD session。

I did not use the git trace as you did when I had a similar issue, but I was getting 3 "detecting host provider for" messages every time I did a fetch.当我遇到类似问题时,我没有像您那样使用 git 跟踪,但是每次我进行提取时都会收到 3 条“正在检测主机提供程序”消息。 I was on git 2.33.1.windows.1 and wasn't using https remotes before then.我在 git 2.33.1.windows.1 之前没有使用 https 遥控器。 (2.33.1 stopped allowing rsa/sha-1 keys apparently, and I switched to personal access tokens while troubleshooting.) I was already using credential manager core so my solution was to add a credential.provider setting to.gitconfig telling it that I am connecting to a bitbucket server. (2.33.1 显然停止允许 rsa/sha-1 密钥,我在故障排除时切换到个人访问令牌。)我已经在使用凭证管理器核心,所以我的解决方案是向 .gitconfig 添加一个 credential.provider 设置,告诉它我我正在连接到 bitbucket 服务器。

[credential]
    helper = manager-core
[credential "https://example.com"]
    provider = bitbucket

After doing this I don't get any "detecting host provider" messages and git fetch runs much faster now.这样做之后,我没有收到任何“检测主机提供程序”消息,并且 git 获取现在运行得更快。 https://github.com/microsoft/Git-Credential-Manager-Core/blob/main/docs/configuration.md https://github.com/microsoft/Git-Credential-Manager-Core/blob/main/docs/configuration.md

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 PyCharm 使用来自凭据管理器的 Git 帐户 - PyCharm uses Git account from Credential Manager Jenkins无法从Windows凭据管理器检测到GIT凭据 - Jenkins does not detect GIT credentials from Windows Credential manager 如何在 Windows 的 Git Credential Manager 中的每个 repo 本地存储凭据? - How to store credentials locally per repo in Git Credential Manager for Windows? 清除 git-credential-manager-core 缓存登录 - Clear git-credential-manager-core cached login 使用 Java 中的 windows 凭据管理器获取凭据,用于身份验证进入 git 和其他服务 - Use the windows credential manager in Java to get credentials for authentication into git and other services 获取、拉取、合并或推送对 GitHub 的更改 gitbash 给出 {git: 'credential-cache' is not a git command。 请参阅“git — 帮助”。} - Fetch, pull, merge or push a change to GitHub gitbash gives {git: 'credential-cache' is not a git command. See 'git — help'.} Mobaxterm终端中的Git凭证 - Git credential in Mobaxterm terminal 禁用单个应用程序的凭据管理器 - Disable credential manager for single application Hudson + Windows + GitHub + Git Plugin =非常慢的获取阶段 - Hudson + Windows + GitHub + Git Plugin = really really slow fetch stage 如果其他所有操作失败,则Windows的Git似乎会自动退回到凭证助手“ manager”。 我该如何预防? - Git for windows seems to automatically fall back to credential helper “manager” if everything else fails. How do I prevent this?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM