繁体   English   中英

git clone --recursive 失败

[英]git clone --recursive fails

我在尝试递归克隆 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.

我不确定不一致的错误是怎么回事,或者为什么在不久之前它工作得很好时突然开始发生这种情况。 有两个(单独的)其他问题 ( ¹ 2 ) 提到了每个错误,但是,这是将两个错误封装在一个不相关的问题中。

任何线索可能是什么问题?

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

或者,创建 ssh-key 并将两台计算机的公钥添加到 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)

另一个简单的解决方案,而不是弄乱钥匙......

强制使用 https 而不是 git

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://

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM