I've tried following these instructions: https://stackoverflow.com/a/40312117/21728 which basically do this:
sudo apt-get install libsecret-1-0 libsecret-1-dev
cd /usr/share/doc/git/contrib/credential/libsecret
sudo make
git config --global credential.helper /usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecret
But when I do any network operation, I get this error:
** (process:7902): CRITICAL **: could not connect to Secret Service: Cannot autolaunch D-Bus without X11 $DISPLAY
That's logical I guess as there is indeed no X11 display.
How to make Git credentials caching work on Ubuntu on Windows (WSL)?
This tutorial from Microsoft helped me. Basicly says:
If GIT installed is >= v2.39.0
else if GIT installed is >= v2.36.1
else if version is < v2.36.1