2017-10-08 65 views
4

我尽量推到我的仓库,但我得到了下面无法更改的git账户

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 

之前的错误,我使用的用户名edgarphan,但我已经把它改为PhanVanLinh但它仍然保持edgarphan。 我试图删除项目并再次克隆,卸载git并重新安装,但它不会工作。

enter image description here

全局配置文件 enter image description here

我怎样才能解决这个问题?任何帮助或建议将不胜感激。

+0

git config --global user.name' – unreleased

+0

@unreleased git config --global user.name也是'PhanVanLinh' –

+0

您的图像不会显示 –

回答

8

这与你的user.name/user.email无关设置:那些用于提交中的作者。他们是而不是当您推送到回购时用于身份验证。

如果混帐不问你的GitHub的(新)用户名/密码,使用称为“经理”一个Git凭证帮手,这意味着Git for Windows(做git config credential.helper进行确认)

含义:它正在缓存您的旧凭证并正在自动重复使用它们。

在这种情况下,请转到Windows开始菜单(Windows start),输入“凭证”并选择Windows工具“Windows Credential Manager”。
enter image description here
在里面,你会找到一个条目git.https://github.com,你可以编辑它,并在那里你可以输入你的新的GitHub用户名/密码。 Enter new credentials

然后再试一次。

+2

删除凭证解决了我的问题。我在很多日子里坚持了这个问题,并且常常认为我会把窗户弄脏。非常感谢你,你救了我。 –

+1

同样,这有很大的帮助。 – DAhrens

0

试着找出git配置文件。对于Windows机器,它可能位于

C:\Users\<user_name>\.gitconfig

该命令可以打开配置文件太多,那么你可以编辑和保存

git config --global -e

和设置配置

cd /path/to/new/local/repo 
git remote add origin https://github.com/PhanVanLinh/phanvanlinh.github.io.git 
git push -u origin master 
+0

谢谢。请在我的问题中查看我更新的图片 –

+0

请参阅编辑并让我知道结果@PhanVanLinh – unreleased

+0

我试过了,并且收到了与我的问题相同的错误。 –