If you are a Mac user and have keychain enabled, you to need to remove the authorization information that is stored in the keychain:
- Open up Keychain access
- Click "All items" under category in the left-hand column
- Search for git
- Delete all git entries.
Then you should change your username and email from the terminal using git config
:
$ git config --global user.name "Bob"
$ git config --global user.email "[email protected]"
Now if you try to push to the repository you will be asked for a username and password. Enter the login credentials you are trying to switch to. This problem normally pops up if you signed into GitHub on a browser using a different username and password or previously switched accounts on your terminal.