It's possible with git submodules to checkout multiple repositories as submodules into respective paths, e.g.:
% git submodule add git@.../repo1.git ./here/is/1
% git submodule add git@.../repo2.git ./here/is/2
But what if I need to checkout the contents of repo1
and repo2
both into a single path, ./here/is/3
?
Basically I have a metric shit-ton of submodule repos I need to all be checked out into a very rigid directory hierarchy on the client side when the user does git clone --recursive ...
I want the contents of all submodules to be checked out into ./somepath
. Can it be done?
One thing I considered was using symlinks, but that feels wrong.
EDIT:
I want the contents of 1
and 2
in the above to be placed in the same target directory on the client. I can do this by having the user manually run a script after cloning (it is not possible to have git track a single file), but it seems like there should be a cleaner way to do this -- manually creating a symlink for each submodule is a lot of work, and it seems like the submodule abstraction should be able to handle this.
Maybe my question is a dupe-in-disguise?