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.
More on Authentication and Remote Access
`[email protected]: Permission denied (publickey).` followed by `fatal: Could not read from remote repository.`Beginner`remote: Support for password authentication was removed on August 13, 2021.`Beginner`fatal: Authentication failed for 'https://github.com/org/repo.git/'` with a token that worked last month.Beginner`WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!` when connecting to GitHub over SSH.Intermediate`remote: Repository not found.` for a repo you can open in the browser.Beginner`ssh -T [email protected]` says "Hi someone-else!" but you need your work account.Intermediate