我是使用 GitHub 的新手。我正在尝试从用户存储库中克隆我的第一个文件。
我不断收到此错误:Permission denied (publickey).
fatal: Could not read from remote repository
当我检查以验证公钥是否已附加到我的 GitHub 帐户时,请使用以下命令:ssh-add -1
我收到此错误:The agent has no identities.
我也试过这个:ssh-add ~/.ssh/id_rsa
它告诉我:
Identity added
我还确保我的笔记本电脑的 SSH key 已添加到我的 GitHub 帐户中。我错过了哪些步骤?
我已经扫描了互联网——我迷路了。
最佳答案
您可以通过 2 种方式克隆 github 存储库。您可以在克隆存储库时选择类型。
git clone https://github.com/flyway/flyway.git
如果它是私有(private)存储库,您可能需要提供用户名/密码。
git clone git@github.com:flyway/flyway.git
您需要在您的 PC 中设置 ssh key 并在您的 github 帐户中更新。
阅读更多关于
Adding SSH Keys
Which remote URL should I use?
关于github - 如何从 GitHub 克隆,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26819334/