如何从git终端中完全删除用户信息? [英] How do I completely delete user info from git terminal?
问题描述
几天前,我创建了一个测试git和github帐户.今天,我创建了一个新的github帐户,并使用 git config --global user.name 和 git config --global user.email 命令更新了git终端用户名和电子邮件.但是,当我使用 git push origin master 将仓库推送到我的新github帐户时,它似乎仍使用我之前创建的测试git用户名,并给了我这个错误:
I created a test git and github account a few days ago. Today I created a new github account and updated my git terminal username and email using git config --global user.name and git config --global user.email commands. But when I push a repo using git push origin master to my new github account, it still appears to use the test git username that I created before and gives me this error:
远程:拒绝旧用户名的 github存储库URL 权限.
致命:无法访问 github存储库URL :请求的URL返回错误:403
fatal: unable to access github repo url: The requested URL returned error: 403
我也尝试删除旧用户,但没有任何效果.当我运行 git config --global --list 时,它将显示我的新详细信息.
I've tried deleting the old user too but nothing works. When I run git config --global --list, it shows my new details.
在这里发布之前,我已经尝试了很多事情,所以我真的不知道问题出在哪里.任何帮助将不胜感激!
I've tried a lot of things before posting on here so I really don't know what the problem is. Any help would be greatly appreciated!
推荐答案
我遇到了同样的问题,唯一对我有用的问题是,手动删除了保存在控制面板中的git凭据:控制面板→用户帐户→凭据管理器→Windows凭据管理器→删除github凭据.
I had the same issue, the only thing that worked for me, is manually remove the git credentials save in the control panel: Control Panel → User Accounts → Credential Manager → Windows Credential Manager → erase the github credentials.
尽管我尝试了所有其他git命令配置,但先进行了删除,然后在推送时重新输入用户名和电子邮件,使其连接到正确的帐户.
Although I tried all the other git commands configurations, this deletion, and then re-entering username and email on push, made it connect to the right account.
这篇关于如何从git终端中完全删除用户信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!