Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change git account in Git bash?

Tags:

git

bash

github

I have weird problem with Git bash. I have two Github accounts, let's say A and B. I set my name and email, like in account A:

git config --global user.name  git config --global user.email  

I initialized new repo, did a commit, then push and git bash asked me about login and password to github. By mistake I put login and password for account B! I logged in successfully, but there is no repository I just initialized.

How can I logout and login to different github account? It's not user.name nor user.email

like image 306
Ish Thomas Avatar asked Jan 17 '17 05:01

Ish Thomas


People also ask

How do I run a git bash as a different user?

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". @Fre1234 Great!


1 Answers

Much simpler, as I explained in "How to sign out in Git Bash console in Windows?":

git credential-manager delete <url> 

Here

git credential-manager delete https://github.com 

No need to remove the credential helper which is practical for caching user's password.

like image 193
VonC Avatar answered Sep 19 '22 01:09

VonC