Branch model for multiple projects in the same repository?

0

Issue

We’ve recently switched from CVS to Git and are using Vincent Driessen’s successful Git branching model with a master branch and a develop branch which merges back to master. We started with one project in Git and now we have two separate projects using some common code in a submodule (common). Recently the other project committed a change to develop that we aren’t prepared for, and until we’ve updated our own code, we cannot commit any changes back to develop because we don’t want the other changes.

I thought about branching develop into project-specific branches which merge back into develop, but the owner of common doesn’t want project-specific branches because:

we’ll have to cherry pick commits from the main develop branch in
order to obtain fixes or features that apply to both.

Would it be better to eliminate the develop branch entirely and just merge directly from project-specific branches back to master, or are we doing this all wrong?

Solution

Recently the other project committed a change to develop that we aren’t prepared for, and until we’ve updated our own code, we cannot commit any changes back to develop because we don’t want the other changes.

That means the two projects have different development life-cycles, and should have each their own develop branch.
But if common cannot updated easily by both projects, that means you have to update common yourself (in a project-specific branch of its own)

Before merging your develop branch to the main official develop one, you will need to merge common from the main develop branch to your version of common, resolve any conflict, and merge back common as well.
That way, the common project owner won’t have to cherry-pick or integrate anything.

Answered By – VonC

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave A Reply

Your email address will not be published.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More