【发布时间】:2021-11-01 07:38:07
【问题描述】:
我有两个帐户,一个在 GitLab 上,另一个在 GitHub 上。我已经准备好在 GitLab 上使用 SSH,但后来我想为 GitHub 推送一些东西,所以我按照 GitHub 上的 SSH 设置的分步说明进行操作,然后忘记了这件事。现在,当我尝试推送到旧 GitLab 存储库时,它给了我以下错误
Permission denied (publickey).fatal: Could not read from remote repository.
Please make sure you have the correct access rightsand the repository exists.
【问题讨论】:
-
确保您已注册 ssh 公钥并在本地提供您的私钥(安装在您的 ssh-agent 中)。如果您在为 github 创建新私钥时不小心删除/覆盖了您的 gitlab 私钥,则需要更改 gitlab 以使用该新公钥(或创建另一对并使用它——注意不要破坏您现有的私钥