gitclone

`git clone --recurse-submodules` failure during submodule recursion


I'm trying to clone a rather large set of things via git submodules

I am using this command line:

git clone https://github.com/WerWolv/ImHex --recurse-submodules

This ends up pulling about 20-30 additional submodules. Randomly different modules fail during the clone, the most common:

    error: RPC Failed; curl 92 HTTP/2 ...

Googling for a solution tells me only that it is a network connection issue, try again - but there are no simple ways to do that, and the suggestions are not very practical or achievable:

== my question ==

Why can't (or how can I) tell git to "reclone" only the ones that failed and skip over the ones that are OK?

What I am suggesting and looking for is a "retry" option that understands submodules.


Solution

  • The main clone worked, --recurse submodules is convenience shorthand for doing a git submodule update --init --recursive, (itself convenience shorthand for a batch of legwork) after cloning the main history and that update is having trouble reaching some of the submodule repos.

    You can just cd in to your cloned repo and retry aka issue that submodule update command until everything gets fetched successfully. The update can see whether the recorded commits are already available, it won't re-fetch anything it already has.

    Whatever intermittent trouble you're having, brutally flaky network access or something temporary at the hosting end, with any luck that isn't bad luck retrying will get everything fetched sooner rather than later.