如何在Git bash中更改git帐户? [英] How to change git account in Git bash?

查看:143
本文介绍了如何在Git bash中更改git帐户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Git bash有奇怪的问题.我有两个Github帐户,分别为 A B .我设置了我的姓名和电子邮件,例如在帐户A中:

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 

我初始化了新的存储库,进行了提交,然后推送并git bash询问了有关github的登录名和密码的信息.我误输入了帐户B的登录名和密码!我已成功登录,但是没有我刚刚初始化的存储库.

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.

如何注销并登录到其他github帐户?不是user.name也不是user.email

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

推荐答案

要简单得多,正如我在"如何注销中所述Windows中的Git Bash控制台?:

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

git credential-manager delete <url>

这里

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

无需删除可用于缓存用户密码的凭据帮助程序.

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

这篇关于如何在Git bash中更改git帐户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆