4 ms·
This prompted a shower thought: Isn't N separate repos actually strictly worse than a monorepo with N completely independent long-lived branches, where each per
by akoboldfrying 2y ago
This prompted a shower thought: Isn't N separate repos actually strictly worse than a monorepo with N completely independent long-lived branches, where each person checks out all the ones they need to work on under separate folders with `git worktree add`?
I can think of only 2 ways that the multiple-branch monorepo is worse:
1. If the monorepo is large, everyone has to deal with a fat .git folder even if they have only checked out a branch with a few files.
2. Today, everyone expects different branches in a repo to contain "different versions of the same thing", not "a bunch of different things". But this is purely convention.
The only real benefit that I can see of making a separate repo (over adding a new project directory to a "classic" monorepo) is the lower barrier to getting underway -- you can just immediately start doing whatever you want; the pain of syncing repos comes later. But this is also true when starting work under a new branch in the branch-per-project style monorepo: you can just create a branch from the initial commit, and away you go -- and if you need to atomically make changes across projects, just merge their branches first!
What are the downsides I'm not seeing?
- adastra22 2y ago> a monorepo with N completely independent long-lived branches That's not a monorepo.
- akoboldfrying 2y agoIt's a single git repo. What would you call it?
- sunshowers 2y agoI'd consider continuous integration (people continuously merge their changes into main) to be one of the defining characteristics of a monorepo.
- adastra22 2y ago“Repo” here really means branch. A monorepo is where you put everything into a single branch.