嘿,我正在尝试学习 git,但我收到了致命错误:无法从远程仓库中读取

hey am trying to learn git and i im getting error fatal: could not read from remote repo

我在 Github 上注册,然后创建了名为 lgit 的私人回购(“学习 git”),以至少尝试测试来自 运行 命令终端,但我在尝试将存储库克隆到我的机器时遇到错误。

r3tr0@iCBM:~/test/gittest$ git clone git@github.com:username/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.

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

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

也有可能是你这边也没有配置ssh key

因为您正在尝试使用 SSH 在本地克隆您的存储库。这个你可以查看@Luck的回答。

或者使用用户名和密码,您可以使用 https 克隆您的存储库,获取 git https 进行克隆,如下所示。