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)?
Git can be installed on Windows AND on WSL The root of your file system / is the mount point of your root partition, or folder, in the case of WSL. Not everything under / is the same drive. For example, on my laptop, I've installed two version of Ubuntu (20.04 and 18.04), as well as Debian.
Go to Windows Credentials -> Generic Credentials. Here your credential should be listed if everything is working correctly. Git should add it by default the first time you log in to a new repository.
The . git-credentials file is stored in plaintext. Each credential is stored on its own line as a URL like: https://user:[email protected] When Git needs authentication for a particular URL context, credential-store will consider that context a pattern to match against each entry in the credentials file.
If you installed Git for Windows there is a windows integrated credential manager installed on your system.
You can run windows executables from WSL as found here.
To use it you can run the following command (assuming that your git for windows is installed on C:\Program Files\Git)
git config --global credential.helper "/mnt/c/Program\ Files/Git/mingw64/libexec/git-core/git-credential-manager-core.exe"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With