visual-studio-code - 我使用 ssh 克隆了一个 repo,但是当我现在尝试推送时,我得到了 public key denied 警告

我尝试了 ssh -T git@github.com 并成功通过了身份验证。

这是我尝试推送时遇到的错误。

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.

回答1

从 Visual Studio Code shell 检查您当前的帐户(Linux 上的 id -a 或 Windows 上的 set username)。

还要检查 HOME(echo $HOMEecho %HOME%),因为 Git /SSH 将在 ~/.ssh 中查找您的 key

确保您推送到您自己的存储库(或您拥有的分支),而不是远程上游原始存储库(您可能不拥有或不是其合作者):git remote -v

相似文章

linux - Github 无法使用 ssh 连接

我正在用github设置我的SSHkeys。之前做过很多次,所以我很确定我做对了。但它不起作用。每当我克隆它时,它就会卡在那里大约5-10分钟,然后返回这个Cloninginto'sentry-pyt...

随机推荐

最新文章