最近我在网上学习编程,课程要求我们将作业上传到Github。从那时起,每当我输入git push -u origin master
时,就会出现以下提示:
remote: Permission to my-github-username/mygithubrepo.git denied to rheros.
fatal: unable to access 'https://github.com/my-github-username/mygithubrepo.git/': The requested URL returned error: 403
rheros
是我之前用来提交作业的仓库名称。现在我不再使用rheros
,但命令行仍然认为我要推送到这个仓库。我尝试检查是否有错误的SSH密钥,但一切看起来都很正常。我该如何让命令行有效地忘记之前提交到完全无关的目录的存在? 编辑
git remote --verbose
的输出如下:origin https://github.com/my-github-username/mygithubrepo.git (fetch)
origin https://github.com/my-github-username/mygithubrepo.git (push)
到目前为止,以下的建议都没有帮助我解决问题:似乎
rheros
仓库正在我的命令行背景中运行,我无法弄清如何消除它。
git remote --verbose
的结果? - user3276552