在更改用户名和密码后,无法推送到GitHub

问题描述 投票:0回答:1

我已经克隆了一个项目并且还更改了用户名和电子邮件(到zjffdu2),但是当我尝试将其推送到GitHub时,我得到了以下错误(看起来它仍然试图通过zjffdu推送),有什么我想念的吗? zjffdu是我的全局git名称,而zjffdu2是项目特定的名称。

ERROR: Permission to zjffdu2/myproject.git denied to zjffdu.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

输出git remote -v

origin  https://github.com/zjffdu2/zeppelin.git (fetch)
origin  https://github.com/zjffdu2/zeppelin.git (push)
git github
1个回答
0
投票

在回购中,这应该告诉你你是哪个用户

git config --global -l

这应该让你通过在文本编辑器中打开配置文件来更改git正在使用的用户名

git config --global --edit

与遥控器交互时可能会要求您输入密码。

© www.soinside.com 2019 - 2024. All rights reserved.