61

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

I have googled but can't find any solution.

4 Answers 4

56

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.

Sign up to request clarification or add additional context in comments.

Comments

30

use

git config --global user.name [Your User name] git config --global user.email [Your Email] 

1 Comment

Thanks for the command to actually change the setting. Not just check them.
24

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.

1 Comment

rundll32.exe keymgr.dll, KRShowKeyMgr will open this from the commandline.
5

If you are using GitHub CLI you can use gh auth status to see the current logged account. gh auth login and gh auth logout allow login and logout as required.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.