git-credential-oauth
git-credential-oauth copied to clipboard
Suggest clearing lower-priority credential helpers
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