无法更改git帐户 [英] Unable to change git account

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

问题描述

我尝试推送到我的存储库,但是我得到了下面的错误:

  git push origin master 
remote:对PhanVanLinh / phanvanlinh.github.io.git的许可被拒绝给edgarphan。
致命:无法访问'https://github.com/PhanVanLinh/phanvanlinh.github.io.git/':请求的URL返回错误:403

之前,我使用的是用户名 edgarphan ,但我已经将它更改为 PhanVanLinh 但它仍然保持 edgarphan
我尝试删除项目并再次克隆,卸载git并重新安装,但它不起作用。





我该如何解决这个问题?任何帮助或建议将非常感谢。

解决方案

这与您的 user.name无关 / user.email 设置:这些用于提交中的作者。当您推送到回购时,它们并非用于身份验证。



如果Git不是要求您输入GitHub(新)用户名/密码,那就意味着),输入凭证并选择Windows工具

其中,您会找到一个条目 git.https://github.com ,您可以编辑它,并在其中输入新的GitHub用户名/密码。



然后再试一次。


I try to push to my repository but I got the error below

git push origin master
remote: Permission to PhanVanLinh/phanvanlinh.github.io.git denied to edgarphan.
fatal: unable to access 'https://github.com/PhanVanLinh/phanvanlinh.github.io.git/': The requested URL returned error: 403

Before, I am using username edgarphan but I have already changed it to PhanVanLinh but it still keep edgarphan. I have tried to delete project and clone again, uninstall git and reinstall but it won't work.

global config file

How can I fix this issue? Any help or suggestion would be great appreciated.

解决方案

This has nothing to do with your user.name/user.email settings: those are for authorship in a commit. They are not used for authentication when you push to a repo.

If Git does not ask you for your GitHub (new) username/password, that means Git for Windows is using a Git credential helper called "manager" (do a git config credential.helper to confirm it)

Meaning: it is caching your old credentials and is reusing them automatically.

In that case, go to the Windows start menu (), type "credential" and select the Windows tool "Windows Credential Manager".

In it, you will find an entry git.https://github.com, which you can edit, and where you can enter your new GitHub username/password.

Then try and push again.

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

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