git clone --recursive 失败

3

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

# git clone --recursive git@github.com: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 git@github.com: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.

我不确定这些不一致的错误是怎么回事,或者为什么之前都可以正常运行,突然间就出现了问题。有两个( 不同的 )其他问题( ¹ )提到了每个错误,但是这个问题将两个错误封装在一个无关的问题中。

你有什么线索吗?


也许你安装了一个软件,在你的配置文件中添加了一个新的SSH密钥? - Martin Delille
3个回答

4

与其对密钥进行操作,另一种简单的解决方案是...

将git强制使用https

git config --global url."https://github.com/".insteadOf git@github.com:
git config --global url."https://".insteadOf git://

强制使用git而不是https

git config --global url."git@github.com:".insteadOf https://github.com/
git config --global url."git://".insteadOf https://

2
你可以通过以下两种方式解决这个问题:
一种方式是创建ssh密钥并将两台计算机的公钥添加到github账户中。之后,该命令将会起作用。
 git clone --recursive git@github.com: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)

您IP地址为143.198.54.68,由于运营成本限制,当前对于免费用户的使用频率限制为每个IP每72小时10次对话,如需解除限制,请点击左下角设置图标按钮(手机用户先点击左上角菜单按钮)。 - l'L'l
太好了!不用谢 :). 它没有要求凭据,因为它是一个公共存储库。 - Ayon Nahiyan

0

根据目前的写法,你的回答不够清晰。请编辑以添加更多细节,帮助他人理解这如何回答所提出的问题。你可以在帮助中心找到关于如何撰写好回答的更多信息。 - undefined

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接