Reset git credentials on a Mac

I tried doing a git push, but received this error:

remote: Invalid username or password.
fatal: Authentication failed for ''

So I needed to reset my git credentials using this command (note: after entering this multi-line command, you shouldn’t get any output and that’s okay).

git credential-osxkeychain erase

Then, the next time you git push, you should be prompted for your GitHub username and password. The username to enter was obvious, but GitHub stopped supporting account passwords for git authentication.

Instead, they accept personal access tokens. Here is a GitHub Docs article about creating a personal access token to use as your password. After entering your personal access token as your password in the command line, the next git push should be good to go.