Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Logout and login as another user git bash

I want to logout from Git bash and login it again as another user .

I have googled but can't find any solution.

like image 624
Nisar Avatar asked May 19 '14 14:05

Nisar


People also ask

How do I log into a different user in git bash?

For Windows User: Follow Instructions: Control Panel >> User Account >> Credential Manager >> Windows Credential >> Generic Credential You can change git credential click modify>>provide uname and password Or you can remove git credential. next time when you'll push repo it'll ask you for credential.

How do I logout of GitHub on Gitbash?

Go to: Control Panel → User Accounts → Manage your credentials → Windows Credentials → under Generic Credentials there are some credentials related to GitHub. Click on them and click "Remove". It signed me out so the next time I do a push, it asks me to enter my username and my password. Show activity on this post.


1 Answers

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/config file referring to multiple private ssh keys (also described here). In which case, the Credential Manager would not be involved.
like image 195
VonC Avatar answered Oct 03 '22 02:10

VonC