Interview Prep/Git & GitHub/Authentication and Remote Access

After rotating your PAT, pushes keep failing with the old token on macOS.

IntermediateTroubleshootingAuthentication and Remote Access
Answer

Likely causes → The macOS Keychain still holds the old token and Git keeps sending it.

Diagnose → Open Keychain Access, search for github.com and look at internet-password entries.

Fix →

printf 'protocol=https\nhost=github.com\n\n' | git credential-osxkeychain erase
git push        # prompts and stores the new token

Or delete the entry in Keychain Access.

Prevent → Use gh auth login, so refresh and storage are handled consistently.

All Git & GitHub questions Roadmap: Git & GitHub

More on Authentication and Remote Access