在github.com上更改名称后无法访问我自己的存储库

时间:2019-10-28 19:15:41

标签: git github

因此,我有一个过时的存储库名称,并想对其进行更新。它以前只是一个学校项目的一个小python文件,但现在我使用它来继续学习自己编写数字方法。

我在Github上更改了名称,然后使用了以下命令:

git remote set-url https://github.com/wcneill/numerical-methods.git

然后检查我是否正确使用

git remote -v

但是现在当我尝试进行更改时,出现以下错误:

git push
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

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

我在其他地方读到,这可能是由于某些缓存的信息现在不正确造成的,但不了解该怎么做。我对命令行的了解仅限于基本的git命令。

1 个答案:

答案 0 :(得分:2)

尝试使用以下命令更改git存储库的URL。

git remote set-url origin new.git.url/here

另外,使用 SSH 而不是 HTTPS 克隆您的存储库,它们将是可写的。

下面是获取SSH URL的屏幕截图。

enter image description here