通过SSH克隆子模块在GitHub存储库上递归失败

fumotvh3  于 2023-03-06  发布在  Git
关注(0)|答案(1)|浏览(144)

问题

克隆包含submodules的存储库git@github.com:revanced/revanced-documentation.git在递归克隆子模块时失败:

Cloning into 'revanced-documentation/repositories/revanced-manager'...
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

洞察力

  • 该问题可在本地复制:

git clone --recursive git@github.com:revanced/revanced-documentation.git

  • 资料档案库正在对子模块使用SSH:
[submodule "repositories/revanced-manager"]
    path = repositories/revanced-manager
    url = git@github.com:revanced/revanced-manager.git
    branch = docs
  • 该问题出现在修订版f7770106f8d771893be23837fae9cdf5d06e536e中,以供将来参考
  • 我们的workflow也遇到了同样的问题
  • 对子模块使用HTTP应该可以很好地工作,因为存储库是公共的
  • 使用SSH可以很好地手动克隆子模块资料档案库

注解

因为这个问题在本地和GitHub操作上都可以重现,所以我们假设问题出在仓库配置上。一个解决方案是对子模块使用HTTP,但需要SSH。

dgsult0t

dgsult0t1#

(Not答案:[ab]使用答案框提供格式化的评论)。
对我很有效,没问题:

$ git clone --recursive git@github.com:revanced/revanced-documentation.git 
Cloning into 'revanced-documentation'...
remote: Enumerating objects: 223, done.
remote: Counting objects: 100% (35/35), done.
remote: Compressing objects: 100% (32/32), done.
remote: Total 223 (delta 18), reused 6 (delta 3), pack-reused 188
Receiving objects: 100% (223/223), 66.31 KiB | 646.00 KiB/s, done.
Resolving deltas: 100% (73/73), done.
Submodule 'repositories/revanced-cli' (git@github.com:revanced/revanced-cli.git) registered for path 'repositories/revanced-cli'
Submodule 'repositories/revanced-manager' (git@github.com:revanced/revanced-manager.git) registered for path 'repositories/revanced-manager'
Submodule 'repositories/revanced-patches' (git@github.com:revanced/revanced-patches.git) registered for path 'repositories/revanced-patches'
Cloning into '/home/phd/tmp/revanced-documentation/repositories/revanced-cli'...
remote: Enumerating objects: 2729, done.        
remote: Counting objects: 100% (9/9), done.        
remote: Compressing objects: 100% (7/7), done.        
remote: Total 2729 (delta 4), reused 7 (delta 2), pack-reused 2720        
Receiving objects: 100% (2729/2729), 629.85 KiB | 1.88 MiB/s, done.
Resolving deltas: 100% (970/970), done.
Cloning into '/home/phd/tmp/revanced-documentation/repositories/revanced-manager'...
remote: Enumerating objects: 5843, done.        
remote: Counting objects: 100% (106/106), done.        
remote: Compressing objects: 100% (83/83), done.        
remote: Total 5843 (delta 35), reused 72 (delta 21), pack-reused 5737        
Receiving objects: 100% (5843/5843), 20.09 MiB | 7.70 MiB/s, done.
Resolving deltas: 100% (3208/3208), done.
Cloning into '/home/phd/tmp/revanced-documentation/repositories/revanced-patches'...
remote: Enumerating objects: 21263, done.        
remote: Counting objects: 100% (388/388), done.        
remote: Compressing objects: 100% (216/216), done.        
remote: Total 21263 (delta 118), reused 345 (delta 90), pack-reused 20875        
Receiving objects: 100% (21263/21263), 3.47 MiB | 6.29 MiB/s, done.
Resolving deltas: 100% (8043/8043), done.
Submodule path 'repositories/revanced-cli': checked out '567bdee887fff2b7788ee49934e6fcc87a5e8046'
Submodule path 'repositories/revanced-manager': checked out 'eb76bf8593f6ef4b0293ab65dc967d4087c7035d'
Submodule path 'repositories/revanced-patches': checked out 'd1c91f97e553ef2da79a5469e698d58ce15c56bd'

相关问题