如何在Git bash中更改git帐户? [英] How to change git account in Git bash?
问题描述
我对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屋!