Re:Git Submodules: Adding, Using, Removing, Updating (2009)
by coryrc on Wednesday February 17, 2021 @11:53AM
(#26168513)
Your later half is essentially what subtree does, but it can also merge changes if you have any.
One alternative solution I like: have a build tool that pulls dependencies in automatically. Bazel supports this natively, but I've also done this in plain ol' Make. Like you can build download rules for deps/github.com/% to automatically pull from GitHub, and the rest of the script can just treat them like local files. Having the build tool take care of it often seems to fit the problem space better too.