git submodule update --init --recursive 时遇到 fatal: clone of ‘...‘ into submodule path ‘...‘ failed

问题描述

报错信息:

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of ‘git@github.com:MJPA/SimpleJSON.git’ into submodule path ‘E:/project/pixyz/PiXYZCore/thirdparty/SimpleJSON’ failed
Failed to clone ‘PiXYZCore/thirdparty/SimpleJSON’ a second time, aborting

解决方法

  1. 在本机生成 ssh 公钥,并复制到 GitHub 的 ssh
    打开 cmd,在命令行运行
ssh-keygen

生成类型和目录全选 yes ,生成公钥(id_rsa.pub)和私钥(id_rsa),默认目录在用户名文件夹下的 .ssh 文件夹中(可以复制上方 yes 部分的目录名称)

将 id_rsa.pub 全部复制后放到 Github 的 ssh 下(主页 -> 个人头像 -> Settings -> SSH and GPC keys)

  1. 在本机尝试 clone 一个仓库,遇到下方对话,输入yes,相当于在 .ssh 文件夹的 known_hosts 中 加入了 github 的 hosts

The authenticity of host ‘github.com (20.205.243.166)’ can’t be established.
ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes

  1. 再次运行 git submodule update --init --recursive,可以顺利运行
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

iteapoy

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值