How to switch git user at terminal?

In addition to changing username and email from terminal using git config:

$ git config --global user.name "Bob"
$ git config --global user.email "[email protected]"

you'll need to remove authorization info from Keychain. This is something I've also struggled with until I found that I also had certificate in my Keychain.

Open up Keychain access, click on All Items and search for git. You will get some items like this:

Screenshot

Delete them. Now try to push the repo and git will ask you to write password for the user and you will be good to go.


For cli users, just use this : git config credential.username 'Billy Everytee'


For Windows User:
Follow Instructions:
Control Panel >> User Account >> Credential Manager >> Windows Credential >> Generic Credential

remove git credential.
next time when you'll push repo it'll ask you for credential.
Answer reference for detailed explanation