首页 > 解决方案 > 嘿,我正在尝试学习 git,但我遇到了致命错误:无法从远程仓库读取

问题描述

我在 Github 上注册,然后创建了名为 lgit(“learn git”)的私有仓库,至少尝试从终端测试运行命令,但在尝试将仓库克隆到我的机器时出现错误。

r3tr0@iCBM:~/test/gittest$ git clone git@github.com:s0ur48h/lgit-rep.git
Cloning into 'lgit-rep'...
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.

标签: linuxgitgithubterminalclone

解决方案


这个问题是因为您没有在 github 中配置 SSH 密钥,我认为这可能会有所帮助:

https://docs.github.com/en/github/authenticating-to-github/adding-a-new-ssh-key-to-your-github-account

也可能是因为您的身边也没有配置 ssh 密钥。


推荐阅读