The CLI configures a credential helper for git.heroku.com as:
[credential "https://git.heroku.com"]
helper = !heroku git:credentials
Git treats credential.helper as an additive list, so this appended helper doesn't replace a globally-configured helper — it runs after it.
For users with a global helper such as Git Credential Manager (GCM):
[credential]
helper =
helper = /usr/local/share/gcm-core/git-credential-manager
...GCM is consulted first for git.heroku.com which:
- Causes unnecessary extra work.
- Could return a stale cached credential, shadowing
heroku git:credentials and causing git push heroku to fail authentication.
Adding a blank helper = reset before the CLI's helper scopes the host to the CLI's helper only. A blank value clears helpers inherited so far for this URL context; other URLs are unaffected:
[credential "https://git.heroku.com"]
helper =
helper = !heroku git:credentials
This mirrors how a global [credential] block commonly resets the list before setting its preferred helper. (And is what GCM does in its own config block.)
Reproduction
- Set a global credential helper, e.g.
git config --global credential.helper manager (GCM).
- Let the CLI write its
git.heroku.com credential config.
- With a stale/incorrect credential cached in GCM for
git.heroku.com, run git push heroku — GCM's credential is used instead of heroku git:credentials, and auth fails.
$ heroku --version
heroku/11.9.0 darwin-arm64 node-v22.23.2
$ which heroku
/opt/homebrew/bin/heroku
The CLI configures a credential helper for
git.heroku.comas:Git treats
credential.helperas an additive list, so this appended helper doesn't replace a globally-configured helper — it runs after it.For users with a global helper such as Git Credential Manager (GCM):
...GCM is consulted first for
git.heroku.comwhich:heroku git:credentialsand causinggit push herokuto fail authentication.Adding a blank
helper =reset before the CLI's helper scopes the host to the CLI's helper only. A blank value clears helpers inherited so far for this URL context; other URLs are unaffected:This mirrors how a global
[credential]block commonly resets the list before setting its preferred helper. (And is what GCM does in its own config block.)Reproduction
git config --global credential.helper manager(GCM).git.heroku.comcredential config.git.heroku.com, rungit push heroku— GCM's credential is used instead ofheroku git:credentials, and auth fails.