Skip to content

Suggest clearing lower-priority credential helpers #92

@FiloSottile

Description

@FiloSottile

As I set this up, I was confused by how git credential-cache exit wouldn't clear the refresh token.

Turns out, Homebrew sets /opt/homebrew/etc/gitconfig to

[credential]
	helper = osxkeychain

so my refresh tokens were ending up persisted.

There is a way around that:

If credential.helper is configured to the empty string, this resets the helper list to empty (so you may override a helper set by a lower-priority config file by configuring the empty-string helper, followed by whatever set of helpers you would like).

https://git-scm.com/docs/gitcredentials#Documentation/gitcredentials.txt-helper

Maybe the installation instructions should recommend that?

git config --global --unset-all credential.helper
git config --global --add credential.helper "" # disable system helpers
git config --global --add credential.helper "cache --timeout 21600" # six hours
git config --global --add credential.helper oauth

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions