Since a couple of weeks ago I've experienced a very annoying issue with git in Ubuntu on my Windows 10 system (WSL2). When doing a git fetch, pull or clone against a repo on Azure Devops it takes several minutes before something happens. Cloning from github is no problem and git in windows works just fine (including devops), it's only in Ubuntu and with devops this happens.
When searching for information about this the only related issues I've found people having is slow git performance when working from a mounted windows folder, but I'm working from the home folder in Ubuntu.
I'm using Docker devcontainers with WSL2 and the problem occurs there as well.
I have no idea what I did a couple of weeks ago that caused this!
Just look at this:
18:47:32.905545 read-cache.c:2306 performance: 0.000062544 s: read cache .git/index
18:53:48.594716 trace.c:475 performance: 0.000394139 s: git command: /usr/lib/git-core/git rev-list --objects --stdin --not --all --quiet --alternate-refs
18:53:48.602112 trace.c:475 performance: 0.001176611 s: git command: /usr/lib/git-core/git gc --auto
18:53:48.602259 trace.c:475 performance: 375.702683388 s: git command: git fetch -p
=============
.gitconfig in Ubuntu (the one in Windows is essentially the identical):
[user]
name = Anders H*******
email = anders.h***@*****.eu
[credential]
helper = /mnt/c/Program\\ Files/Git/mingw64/bin/git-credential-manager.exe
[merge]
tool = meld
[diff]
tool = meld
[mergetool "meld"]
keepBackup = false
trustExitCode = false
[mergetool]
prompt = false
[difftool "meld"]
cmd = Meld.exe "$LOCAL" "$REMOTE"
[difftool]
prompt = false
[credential "https://dev.azure.com"]
useHttpPath = true
I had an idea that it could have something to do credential management. I had both Github CLI and Git for windows (with git-credential-manager) installed and my thought was that there where some conflict. So I uninstalled Github CLI and updated Git for Windows to the latest version. This had no effect.
Another thought is that it has something to do with the fact that I started working with Docker devcontainers in VSCode at about the same time when the issue started to occur. I have however not been able to find anything related to this.
Update
Using SSH I don't experience this issue, so it obviously has something to do with credential management. I do however have no clue to what it could be!