git clone --recursive失败

问题描述 投票:1回答:1

我在尝试递归克隆git存储库时遇到了一个奇怪的问题:

# git clone --recursive [email protected]:eteran/edb-debugger.git
Initialized empty Git repository in /edb-debugger/.git/
The authenticity of host 'github.com (192.30.253.113)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,192.30.253.113' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: The remote end hung up unexpectedly

尝试在另一台机器上返回不同的结果:

$ git clone --recursive [email protected]:eteran/edb-debugger.git
Cloning into 'edb-debugger'...
Warning: Permanently added the RSA host key for IP address '192.30.253.112' to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

我不确定不一致的错误会发生什么,或者为什么在不久之前它完全正常工作时突然发生这种情况。有两个(单独的)其他问题(¹)提到每个错误,但是,这是将两个错误封装在一个不相关的问题中。

有什么问题可能是什么?

git
1个回答
1
投票

您可以通过两种方式解决此问题:

或者,创建ssh-key并在github帐户中添加两台计算机的公钥。之后,此命令将起作用

 git clone --recursive [email protected]:eteran/edb-debugger.git

或者,使用https进行克隆。这将提示凭据输入凭据并将其克隆

git clone --recursive https://github.com/eteran/edb-debugger.git

如果您对已创建的ssh密钥有问题,请使用此命令查看您的ssh密钥是否已正确加载,并且您的公钥是否已正确添加到您的github帐户中。要查看加载的密钥:

ssh-add -l

它应该列出你的密钥:

2048 SHA256:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX /Users/<username>/.ssh/id_rsa (RSA)
© www.soinside.com 2019 - 2024. All rights reserved.