You don’t have to “logout” or “login”: regarding git, who you are is determined by:
git config user.name
git config user.email
Change those two settings while being in a repo, if you are someone else, when it comes to creating commits.
If you want to change it in your local machine for all repos, add –global like
git config --global user.name [your username]
As suggested by the Deepak swain’s answer, you can also change credentials in Windows using the Credentials Manager by typing in the console:
rundll32.exe keymgr.dll, KRShowKeyMgr
As Kartik Ranpise answer’s and Stuart Axon’s contribution
But Credentials are about git remote -v, that is with the user account you will use to push to the upstream repo.
- for an HTTPS url, you can simply specify a new user
- for ssh, you would need a
~/.ssh/configfile referring to multiple private ssh keys (also described here). In which case, the Credential Manager would not be involved.