| title | gh credential helper path mismatch silently breaks git push | ||||||
|---|---|---|---|---|---|---|---|
| domain | devops | ||||||
| tags |
|
||||||
| status | published | ||||||
| lang | en | ||||||
| source | uncledad96-glitch | ||||||
| translated_from | lessons/contrib/git-credential-helper-gh-path-mismatch.md | ||||||
| created | 2026-07-20 | ||||||
| updated | 2026-07-20 |
English translation of
lessons/contrib/git-credential-helper-gh-path-mismatch.md
git push hangs or errors with:
/home/hp/.local/bin/gh auth git-credential get: 1: /home/hp/.local/bin/gh: not found
or:
remote: Repository not found.
fatal: repository 'https://github.com/...' not found
even when the repo exists and the token is valid.
gh may live at /usr/bin/gh while git鈥檚 credential helper points at a stale path:
credential.https://github.com.helper=!/home/hp/.local/bin/gh auth git-credential
Common after mixed install methods (apt vs manual) or moved user local bins.
git config --global --list | grep credential
git config --global --unset-all credential.https://github.com.helper
git config --global --unset-all credential.https://gist.github.com.helper
git config --global credential.helper store
# ensure ~/.git-credentials has a valid token
cat ~/.git-credentials
git ls-remote origin HEADOr point the helper at the real binary:
git config --global credential.https://github.com.helper '!$(command -v gh) auth git-credential'git config --global --list | grep helper
git ls-remote origin HEAD # returns a commit hash