I have a project in Git that has several submodules, and I need these submodules that need to be downloaded, and the files available for using the main project, and for the submodules to work, I need their own submodules to be available, etc. . Therefore, to establish this, I recursively initialize submodules using git submodule update --init --recursive .
However, I noticed that many of my submodules share common dependencies, looking something like this in the pseudocode ( alpha -> beta means alpha has the beta submodule)
my project -> submodule a -> submodule m -> submodule b -> submodule m -> submodule n -> submodule x -> submodule c -> submodule x
My question is: is there a way to avoid this duplication using only git, saving (at least one copy) files for each submodule?
I can imagine a solution with symbolic links, but it would be preferable if Git handled this for me, and I'm not sure if installing the symbolic links itself will cause problems when updating submodules.
Ideally, I would like to simplify it:
my project -> submodule a -> symlink(submodule m) -> submodule b -> symlink(submodule m) -> symlink(submodule n) -> submodule c -> symlink(submodule x) -> submodule m -> submodule n -> symlink(submodule x) -> submodule x
Thanks in advance for any suggestions!
git git-submodules
iainbeeston Nov 06 '10 at 23:55 2010-11-06 23:55
source share