Git – Should we use a monorepo

gitmigrationsvnversion control

My team is planning a migration from subversion to git. We support 3 applications… 1 is primarily for internal users, 1 is for corporate "partners" and 1 is for end users. These applications share some code and also communicate with each other using web services and message queuing. They have different release schedules.

Currently they each have separate subversion repos (so 3 repos). We use the subversion "externals" feature to share the code, including the "contracts" for message queuing.

How should we go about deciding whether to keep the 3 repos when we move to git, using submodules or some other repo sharing technique, or whether we should adopt a monorepo?

Best Answer

My 2 cents: I'd put them in different repos.

  • it's easier to track changes (history, blame...)
  • it's easier to deal with different release cycles (tagging, version branching...)
  • it's easier to deal with (less merges, less branches, no files/dependencies from other projects...)

...as for your "shared code", I'd place it in a lib of its own, in a repo of its own. Or, if it's just about interfacing, declare one project as a dependency of another.

Related Topic