我配置了基于SSH的认证,如下所示
然后试着推,但我得到了以下错误:
Permission denied (public key). fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.我已经读写了对存储库push命令git push -u源文件的访问
有什么想法吗?
发布于 2020-10-05 05:41:18
你应该试着:
GIT_SSH_COMMAND="ssh -Tv" git push您将看到Git作为SSH密钥所使用的内容,以及是否存在任何错误消息。
如果错误仍然存在,有可能是某些因素阻止SSH正确操作(as in here,当未连接到VPN时)。
当然,使用HTTPS是一个解决办法:
git remote set-url origin https://git@bitbucket.XXX.com/XXX.com/XXX.git在discussion之后,缺少的步骤是将私钥添加到ssh-agent中。
ssh-add OEDQ_BIT added the private keyhttps://stackoverflow.com/questions/64202688
复制相似问题