git-credential-manager icon indicating copy to clipboard operation
git-credential-manager copied to clipboard

git-credential-manager adds `credential.helper` to git config even if it's already configured

Open ananthb opened this issue 2 years ago • 10 comments

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.

ananthb avatar Jul 15 '23 05:07 ananthb

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.

ldennington avatar Jul 17 '23 19:07 ldennington

gitconfiglist.txt

I've noticed it happen thrice in a span of a few months. I think it coincides with when gcm is updated by homebrew.

ananthb avatar Jul 21 '23 10:07 ananthb

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?

ldennington avatar Jul 24 '23 02:07 ldennington

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.

ananthb avatar Jul 26 '23 08:07 ananthb

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.

ldennington avatar Jul 31 '23 21:07 ldennington