Git似乎停留在我的旧帐户上

时间:2014-05-08 04:08:36

标签: git github

我开始尝试使用git和github。我已经创建了一个存储库,我正在尝试发布。我收到的错误看起来像这样:

$ git push origin master

ERROR: Permission to myuser/MyProject.git denied to OldAccount.
fatal: could not read from remote repository

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

让我感到惊讶的是git认为我是OldAccount。这是我在一年前第一次使用git实验时创建的用户名。我今天决定创建一个新帐户,我正在尝试使用我的新帐户,但是git一直在尝试使用我的旧帐户发布。我正在使用GitHub for Windows应用程序,它肯定已登录到我的帐户。那么OldAccount如何仍然出现?

2 个答案:

答案 0 :(得分:1)

同时检查您的git config user.email

电子邮件必须是与您的新帐户关联的电子邮件,而不是旧帐户 (最近的答案在" Git commits associated with old, defunct user instead of the user I have now")

进行了说明

关于推送,请确保您的网址不是https版,其中包含您的旧网址:

htps://OldLogin@github.com/newLogin/newRepo

(输入git remote -v查看' origin' url)

如果它使用ssh url,那么如上所述,请检查您的公钥:

答案 1 :(得分:0)

我认为您的公共SSH密钥仍然添加到旧帐户中。

相关问题