5 ms·
git has submodules. A repo can thus host any number of sub-repos. Using modules can also be pretty much like having a monorepo if you have a master repo with a
by pierrebai 6y ago
git has submodules.
A repo can thus host any number of sub-repos. Using modules can also be pretty much like having a monorepo if you have a master repo with all others under it. This way, you can still publish things like public API as a repo.
- mumblemumble 6y agoThey don't work quite the same way as svn externals, though, in a way that didn't work for us. In particular, they leave no good way to deal with merging in upstream changes in a submodule's code if you've also made some of your own (provisional) edits.
- mceachen 6y agoSubmodules don't allow for atomic commits that span repos, though. Atomic cross-project commits are the most compelling selling feature for monorepos IMHO. (A common case for this is changing a function's API, and fixing all downstream consumers, in one tidy, holistic PR).
- JoshTriplett 6y ago> Submodules don't allow for atomic commits that span repos, though. They can, but there's little tooling support to help you do so. You can make a new commit in one repo, and then in one atomic commit, you can pull that new commit into a parent repo's submodule and fix the users calling into that submodule.