git-ecosystem / git-ecosystem/git-credential-manager
git-redential-manager get is extremely slow sometimes
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 9.3k
- Forks
- 2.9k
- Avg merge
- 7d 1h
- Merged PRs (30d)
- 14
Description
Version
2.5.1+90d5f897f164a8fe07d2aa3bf7db439b0b4e03ea
Operating system
Windows
OS version or distribution
Windows 11 23H2 x64
Git hosting provider(s)
Other - please describe below
Other hosting provider
Both GitHub and Azure DevOps
(Azure DevOps only) What format is your remote URL?
https://{org}@dev.azure.com/{org}
Can you access the remote repository directly in the browser?
Yes, I can access the repository
Expected behavior
git pull and git fetch complete in reasonable time.
Actual behavior
Roughly 10% of the time when I run git pull or git fetch, it takes ~15s to complete (usually it's ~1s). It doesn't pull any big updates, I can just spam git pull in the terminal and it will produce this issue occasionally. I've enabled trace logging and found that the first git-credential-manager get call sometimes takes ~15s to complete and I don't know why. This seems to be repository agnostic (at least it happens with different repos on github and Azure DevOps. I've tested some of the repos on other machines in the same network and they don't have this issue. I've also tested with the same machine in two different networks and it happened in both of them.
Things I've also tried:
- set the credential provider to
genericin my .gitconfig - clear all git related credentials in the Windows Credential Manager
- reinstall git and delete my git config
git credential-manager azure-repos clear-cache
None of these steps solved the issue and I'm at a loss of how to debug this further.
Logs
Trace logs for git pull:
09:10:33.001709 exec-cmd.c:243 trace: resolved executable dir: C:/Program Files/Git/mingw64/bin
09:10:33.003730 git.c:465 trace: built-in: git pull
09:10:33.010726 read-cache.c:2392 performance: 0.006184700 s: read cache .git/index
09:10:33.049335 preload-index.c:171 performance: 0.037780500 s: preload index
09:10:33.050227 read-cache.c:1634 performance: 0.038517500 s: refresh index
09:10:33.051235 diff-lib.c:288 performance: 0.000320000 s: diff-files
09:10:33.053234 unpack-trees.c:2006 performance: 0.000011100 s: traverse_trees
09:10:33.053234 unpack-trees.c:438 performance: 0.000003500 s: check_updates
09:10:33.053234 unpack-trees.c:2098 performance: 0.000431800 s: unpack_trees
09:10:33.053234 diff-lib.c:654 performance: 0.000506300 s: diff-index
09:10:33.053234 run-command.c:657 trace: run_command: git merge-base --fork-point refs/remotes/origin/master master
09:10:33.081263 run-command.c:657 trace: run_command: git fetch --update-head-ok
09:10:33.097007 exec-cmd.c:243 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
09:10:33.098009 git.c:465 trace: built-in: git fetch --update-head-ok
09:10:33.105009 read-cache.c:2392 performance: 0.006537400 s: read cache .git/index
09:10:33.108025 run-command.c:657 trace: run_command: GIT_DIR=.git git remote-https origin REPO_URL
09:10:33.124515 exec-cmd.c:243 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
09:10:33.125532 git.c:750 trace: exec: git-remote-https origin REPO_URL
09:10:33.125719 run-command.c:657 trace: run_command: git-remote-https origin REPO_URL
09:10:33.141672 exec-cmd.c:243 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
09:10:33.479315 run-command.c:657 trace: run_command: 'git credential-manager get'
09:10:48.527251 exec-cmd.c:243 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
09:10:48.528203 git.c:750 trace: exec: git-credential-manager get
09:10:48.528203 run-command.c:657 trace: run_command: git-credential-manager get
09:10:48.594775 exec-cmd.c:243 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
09:10:48.596775 git.c:465 trace: built-in: git config --null --list
09:10:48.596775 trace.c:414 performance: 0.001134100 s: git command: 'C:/Program Files/Git/mingw64/libexec/git-core\git.exe' config --null --list
09:10:48.679436 trace.c:414 performance: 0.151675500 s: git command: 'C:\Program Files\Git\mingw64\libexec\git-core\git.exe' credential-manager get
09:10:48.759250 run-command.c:657 trace: run_command: 'git credential-manager store'
09:10:48.808134 exec-cmd.c:243 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
09:10:48.809132 git.c:750 trace: exec: git-credential-manager store
09:10:48.809132 run-command.c:657 trace: run_command: git-credential-manager store
09:10:48.871904 exec-cmd.c:243 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
09:10:48.872900 git.c:465 trace: built-in: git config --null --list
09:10:48.873918 trace.c:414 performance: 0.000994900 s: git command: 'C:/Program Files/Git/mingw64/libexec/git-core\git.exe' config --null --list
09:10:48.971395 trace.c:414 performance: 0.162323100 s: git command: 'C:\Program Files\Git\mingw64\libexec\git-core\git.exe' credential-manager store
09:10:48.992378 run-command.c:657 trace: run_command: git rev-list --objects --stdin --not --exclude-hidden=fetch --all --quiet --alternate-refs
From REPO_URL_WITHOUT_USER
* [new branch] Foo -> origin/Foo
09:10:49.037430 trace.c:414 performance: 15.912550800 s: git command: git remote-https origin REPO_URL
09:10:49.040106 run-command.c:1521 run_processes_parallel: preparing to run up to 1 tasks
09:10:49.040106 run-command.c:1549 run_processes_parallel: done
09:10:49.040106 run-command.c:657 trace: run_command: git maintenance run --auto --no-quiet
09:10:49.056126 exec-cmd.c:243 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
09:10:49.058128 git.c:465 trace: built-in: git maintenance run --auto --no-quiet
09:10:49.060123 trace.c:414 performance: 0.002921300 s: git command: git maintenance run --auto --no-quiet
09:10:49.062136 trace.c:414 performance: 15.964827600 s: git command: git fetch --update-head-ok
09:10:49.065651 run-command.c:657 trace: run_command: git merge --ff-only --no-autostash FETCH_HEAD
09:10:49.081652 exec-cmd.c:243 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
09:10:49.083870 git.c:465 trace: built-in: git merge --ff-only --no-autostash FETCH_HEAD
09:10:49.092669 read-cache.c:2392 performance: 0.006409300 s: read cache .git/index
Already up to date.
09:10:49.094197 trace.c:414 performance: 0.012202200 s: git command: git merge --ff-only --no-autostash FETCH_HEAD
09:10:49.097237 trace.c:414 performance: 16.094451100 s: git command: git.exe pull
git credential-manager diagnose:
Diagnose log at 2024-08-14T07:59:01Z
AppPath: C:\Program Files\Git\mingw64\bin\git-credential-manager.exe
InstallDir: C:\Program Files\Git\mingw64\bin\
Version: 2.5.1+90d5f897f164a8fe07d2aa3bf7db439b0b4e03ea
------------
Diagnostic: Networking
Skipped: False
Success: True
Exception: None
Log:
Checking networking and HTTP stack...
Creating HTTP client... OK
IsNetworkAvailable: True
Sending HEAD request to http://example.com...Sending HEAD request to https://example.com... OK
OK
Acquiring free TCP port... OK
Testing local HTTP loopback connections...
Creating new HTTP listener for http://localhost:58323/... OK
Waiting for loopback connection... OK
Writing response... OK
Waiting for response data... OK
Loopback connection data OK
------------
Diagnostic: Git
Skipped: False
Success: True
Exception: None
Log:
Getting Git version... OK
Git version is '2.46.0.windows.1'
Listing all Git configuration... OK
Git configuration:
file:C:/Program Files/Git/etc/gitconfig diff.astextplain.textconv=astextplain
file:C:/Program Files/Git/etc/gitconfig filter.lfs.clean=git-lfs clean -- %f
file:C:/Program Files/Git/etc/gitconfig filter.lfs.smudge=git-lfs smudge -- %f
file:C:/Program Files/Git/etc/gitconfig filter.lfs.process=git-lfs filter-process
file:C:/Program Files/Git/etc/gitconfig filter.lfs.required=true
file:C:/Program Files/Git/etc/gitconfig http.sslbackend=openssl
file:C:/Program Files/Git/etc/gitconfig http.sslcainfo=C:/Program Files/Git/mingw64/etc/ssl/certs/ca-bundle.crt
file:C:/Program Files/Git/etc/gitconfig core.autocrlf=true
file:C:/Program Files/Git/etc/gitconfig core.fscache=true
file:C:/Program Files/Git/etc/gitconfig core.symlinks=true
file:C:/Program Files/Git/etc/gitconfig pull.rebase=true
file:C:/Program Files/Git/etc/gitconfig credential.helper=manager
file:C:/Program Files/Git/etc/gitconfig credential.https://dev.azure.com.usehttppath=true
file:C:/Program Files/Git/etc/gitconfig init.defaultbranch=master
file:C:/Users/REDACTED/.gitconfig user.email=REDACTED
file:C:/Users/REDACTED/.gitconfig user.name=REDACTED
file:C:/Users/REDACTED/.gitconfig push.autosetupremote=true
file:C:/Users/REDACTED/.gitconfig pull.rebase=true
file:C:/Users/REDACTED/.gitconfig filter.lfs.smudge=git-lfs smudge -- %f
file:C:/Users/REDACTED/.gitconfig filter.lfs.process=git-lfs filter-process
file:C:/Users/REDACTED/.gitconfig filter.lfs.required=true
file:C:/Users/REDACTED/.gitconfig filter.lfs.clean=git-lfs clean -- %f
file:C:/Users/REDACTED/.gitconfig core.editor=nvim
------------
Diagnostic: Credential storage
Skipped: False
Success: True
Exception: None
Log:
ICredentialStore instance is of type: CredentialStore
Writing test credential... OK
Reading test credential... OK
Deleting test credential... OK
------------
Diagnostic: Microsoft authentication (AAD/MSA)
Skipped: False
Success: True
Exception: None
Log:
Broker is not enabled.
Flow type is: Auto
Gathering MSAL token cache data... OK
CacheDirectory: C:\Users\REDACTED\AppData\Local\.IdentityService
CacheFileName: msal.cache
CacheFilePath: C:\Users\REDACTED\AppData\Local\.IdentityService\msal.cache
Creating cache helper... OK
Verifying MSAL token cache persistence... OK
------------
Diagnostic: GitHub API
Skipped: False
Success: True
Exception: None
Log:
Using 'https://github.com/' as API target.
Querying '/meta' endpoint... OK
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the git credential-manager get entry point and the supplied Git trace logs, focusing on the intermittent 15-second delay on Windows. Use git credential-manager diagnose and compare affected and normal runs; done means the cause is identified and the credential lookup no longer incurs the unexplained delay.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, git
- Domain
- authentication, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100