How to change git account in git bash?

I have a weird issue with git bash. I have accounts Github, say A and Bed and . I set my name and email address, for example, on account A:

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

I initialized a new repo, committed, then click and git bashasked me about the login and password for github. By mistake, I set the username and password for account B !! I registered successfully, but there is no repository that I just initialized.

How can I log out and log in to another github account? It is not user.nameanduser.email

+10
source share
5 answers

, Git Bash Windows?":

git credential-manager delete <url>

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

, .

+4

git ~/.git-credentials ~/.config/git/credentials. , , .

$ git config --global --unset credential.helper

# search file
$ sudo find / -type f -name .git-credentials
$ sudo find / -type f -name credentials

Windows, manager . Control Panel Interface, edit or delete .

$ git config --global credential.helper manager
+1

: SSH.

. ssh ~/.ssh/id_rsa.pub. GashHub ssh https://github.com/settings/keys.

GitHub CLI, GitHub , .

Git GitHub. ~/.ssh/id_rsa.pub B GitHub.

, GitHub, GitHub , B.

0

In my situation, I changed the email address of my account to gitlab.com, then my local git repository cannot push. saTya response worked, but on Windows in October 1903 is a Control PanelCredential ManagerWindows credentialsGeneral credentials ,

0
source

Source: https://habr.com/ru/post/1666973/


All Articles