我已经克隆了一个项目并且还更改了用户名和电子邮件(到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 config --global -l
这应该让你通过在文本编辑器中打开配置文件来更改git正在使用的用户名
git config --global --edit
与遥控器交互时可能会要求您输入密码。