Roman
Roman

Reputation: 53

How to change account in GitBash

i would like to change my account in gitbash. The usual

1.delete credentials via windows-credential manager or

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

Issue: Doesn't work / doesn't do anything

Question: $ git config -l delievers an user.email which i don't want to use / i.e. want to logout from the present account an login into a new one. How do i do that?

Upvotes: 0

Views: 596

Answers (2)

Roman
Roman

Reputation: 53

You need to directly change the username/email in the config, in order to commit from a another account.

$ git config --global user.name "GithubUsername"

$ git config --global user.email "Email"

Upvotes: 0

Zam Abdul Vahid
Zam Abdul Vahid

Reputation: 2721

As of 2018 "delete" is deprecated, use reject instead.

git credential-manager reject <url>

OR

git config --global credential.helper wincred

Next time when you do a git action such as clone, push, pull etc the username & password prompt will appear for you to enter the new credentials you want to use.

Upvotes: 1

Related Questions