Check if your git installation is using the OSX Keychain to store credentials by running
git config --global credential.helper. If that returns
osxkeychain then it is.
You'll need to update your saved username and password in the git-credential-osxkeychain helper if you change your password or username on GitHub.
- In Finder, search for the Keychain Access app.
- In Keychain Access, search for github.com.
- GitHub Password Entry in KeychainFind the "internet password" entry for github.com.
- Edit or delete the entry accordingly.
Another thing you might need to check is if you are using 2 factor authentication for the github account you are pushing as? If you are then you might need this from here:
When 2FA is enabled
If you have two-factor authentication enabled, you must create a personal access token to use as a password when authenticating to GitHub on the command line with HTTPS URLs.
For example, when you access a repository using Git on the command line using commands like git clone, git fetch, git pull or git push with HTTPS URLs, you must provide your GitHub username and your personal access token when prompted for a username and password.
For more information on setting up two-factor authentication, see "Adding security to your account with two-factor authentication."