2 ms·
> Do I want submodules or subtree?" There is a sane third alternative: you add the dependency as an upstream directly to your repo and fetch its objects. You t
by kazinator 3y ago
> Do I want submodules or subtree?"
There is a sane third alternative: you add the dependency as an upstream directly to your repo and fetch its objects. You track it on a branch in which only that dependency exists (there is nothing else in the tree). You perform a rename which moves that dependency into the directory where you want it. Then you merge or cherry pick the renamed version of the dependency into your trunk.
The one advantage of a submodule is that you can maintain a separation if you locally hack the dependency. Your commits to the submodule are entirely separate from your project's stream, and could be published independently and possibly upstreamed by that submodule's project.
These activities are not impossible if you integrate like I recommend above, but they become more work.