3 ms·
Subtree makes the most sense when you have a component that is completely dominated by its parent, but which you want to also release stand-alone. For example,
by jedbrown 13y ago
Subtree makes the most sense when you have a component that is completely dominated by its parent, but which you want to also release stand-alone. For example, we use it for a build system that gets 90% of its use and testing (and essentially all its development) from one parent project, but is used in a few other much smaller projects.
Submodules provide weaker coupling and make the most sense when the submodule has its own healthy upstream and you want to track those versions. It's awkward if all submodule development is happening from within the parent.
My rule of thumb: If the sub-project has a test suite that is complete enough you can trust it, then use submodules or a different installation method. If the sub-project always needs the parent (preferably only one parent) to verify correctness, such that you prefer to make commits from the parent repository, use subtree.