git-credential-manager
git-credential-manager copied to clipboard
git-credential-manager adds `credential.helper` to git config even if it's already configured
git-credential-manager keeps adding the credential.helper configuration option to my $HOME/.config/git/config file repeatedly. This config option is already present in a file that is included by $HOME/.config/git/config, but gcm is unable to see this.
Can you share what you see when you run the command git config --list --show-origin? Also, is there a specific command that you've noticed triggers the config addition? If so, please enable tracing using these instructions (please set both GIT_TRACE2=1 and GCM_TRACE=1) and include the output in your response.
I've noticed it happen thrice in a span of a few months. I think it coincides with when gcm is updated by homebrew.
Looking at the output of the git config --list --show-origin command, I only see 3 credential.helper values, all of which are expected. The first is the macOS default helper of osxkeychain. This is overridden by GCM with the special syntax of adding credential.helper= (the empty string resets the helper list) and then credential.helper=/usr/local/share/gcm-core/git-credential-manager. What are you seeing that is making you concerned the config is being added over and over again?
The values itself aren't the issue.
When I first installed GCM, they were added automatically to ~/.config/git/config. I moved them to ~/.config/git/local. Every few weeks (maybe coinciding with updates), the same options get added to ~/.config/git/config even though they exist in my config set.
GCM does not check for or follow any config includes when determining whether or not credential.helper has been set appropriately. This will be why it keeps re-configuring itself in your $HOME/.config/git/config.