Devcontainers: Is it possible to forward the Windows host git-credential-manager credentials?
Hello,
I use IntelliJ IDEA 2026.2.2 on Windows 11 and Docker Desktop for creating a devcontainer. I have configured IntelliJ's devcontainers to use WSL2 with a Ubuntu 26.04 distribution.
I have created a Devcontainer from a Git repository I have cloned locally, that's hosted in an Azure DevOps organization, which I can run from IntelliJ and it seems to work. However, when I perform any Git functions that require access to the remote repo such as pull, push or clone, I am asked to log in again which is tedious because Azure DevOps (dev.azure.com) in our org doesn't allow simple credentials - I have to create and supply access tokens and renew them when expired.
user ➜ /workspace $ git pull
Password for 'https://exampleorg@dev.azure.com/exampleorg/project/_git/repo': This applies to both the terminal and Version Control functions in the IntelliJ GUI. When set the git credential.helper within the devcontainer, IntelliJ's GUI offers to use that, but the path is not valid within the container and it exits with an error.
git config --global credential.helper "/mnt/c/Program\ Files/Git/mingw64/bin/git-credential-manager.exe"
What I found so far:
VSCode's devcontainer implementation seems to support a way to forward credentials from the Windows host into the devcontainer: https://code.visualstudio.com/remote/advancedcontainers/sharing-git-credentials#_using-a-credential-helper
I found one topic and a bugtracker issue related to IntelliJ, but it's specifically about SSH and GPG credentials.
There seems to be a workaround using the Linux .NET SDK's git-credential-manager but I have not tried that, for the reasons stated in the issue i.e. plaintext storage: https://github.com/git-ecosystem/git-credential-manager/issues/1549
Question:
Is credentials forwarding from a Windows host into a devcontainer something that should already work, have I missed a setting or config?
Please sign in to leave a comment.