We have 4 repos with executables and when I clone any 1 of them, I want to also clone all of the 8 repos with libraries to the folders next to the executable folder. The executables are something like services, all 4 of them will use the latest versions from main repositories of the libraries. I also want to clone all of the 8 library repos when I clone any 1 of them.
So I can for example clone executable1 and have folders: executable1-library1-..-library8 or clone library1 and have folders: library1-..-library8 or end up cloning all of the executables and have folders: executable1-..-executable4-library1-..-library8.
So I don't want to download all of the executables everytime, but I want to download all of the libraries everytime.
I have been thinking about submodules, but their documentation is terrible, maybe the whole feature is poor, I don't know. Then I have been thinking about subtrees and other structures from git. There is also a possibility that I will always just clone all of the 8 libraries separately manually, that would be sad.
So what is the best way to 1) automatically download all of the 8 libraries to their folders (next to the folder of the executable if it was caused by cloning executable)? 2) automatically download all of the 8 libraries to their folders next to the folder of the executable during the cloning of the executable?
The first option is more basic - to have it done in 2 steps (1.executable+2.libraries), the second is way better for me, to just have it done in 1 step(executable&libraries together).
Part of my question was solved here: Git: Possible to use same submodule working copy by multiple projects?
I also want to make changes to the libraries even if they were downloaded with the executable and push those changes to their repositories.
EDIT: I added last sentence and added that also 1 library should also download other libraries.