user1431368
user1431368

Reputation: 595

Structured releases (Git flow) for multiple projects in a single repository (monorepo)

I'm using Git Flow with multiple projects, each with their own repository, successfully.

I'm looking to merge these repositories into a single monorepo. The main reason being shared dependent projects across multiple projects, which, currently means we need to commit fixes across multiple repositories (see: cross-project changes in the link above).

Facebook and Google seem to successfully use this model (see: this fb talk, and this google talk).

How can I keep using something similar to Git Flow while utilizing a single repository for multiple projects?

While useful, the talks I've linked to don't go into details like branching and tagging, and how they organize different project releases from a single trunk/master.

I'm not married to Git Flow. I'm looking for how to structure releases in a monorepo.

Upvotes: 29

Views: 7959

Answers (1)

user5483398
user5483398

Reputation:

What about using a branch for each project, and using child branches as git-flow branches with proper namespacing? For example; there's a branch named project#1 for a project, which is analogous to master, and has child branches named project#1-develop, project#1-hotfix#11, and so on. Also you can have the single master branch into which you merge the project branches at releases.

Upvotes: 2

Related Questions