Submodules are great for combining multiple repos into a fixed configuration set (i.e., SHA1, which is a fixed set of each of these submodules recorded by their parent repo)
However, they are always cloned in their own directory.
And they have a lot of other gotchas (see " Why Your Company Shouldn't Use Git Submodules )."
One way around this is to support 2 different sets of working trees:
One of them is not supported by versions, along with all files. One with repositions usually cloned (i.e. with submodules in their own directory).
You can do this all the usual action, but with:
--git-tree for each Git command, --git-tree pointing to the first set (the one that has the whole file)- quite fully
.gitignore , capable of ignoring any file that is not part of their specific repo.
This is not very satisfactory, and indicate that the submodules (even in other VCS that offer them - Hg and subrepos, ClearCase and UCM component, ...) should be separated.
Thus, sharing a jQuery plugin may first include a bit of rethinking file organization to see if these files can really be considered a βsubmoduleβ.
source share