2

We have 2 teams of developers working on a single system. Team A is working on a 'master' branch (our production branch). They will branch from 'master' to feature or bugfix branches and merge back into 'master' for releasing.

Team B is working on an 'upgrade' branch which is branched from 'master'. They follow a similar approach of branching from 'upgrade' to feature or bugfix branches and then merge back into 'upgrade' once their work is done.

Eventually the 'upgrade' branch will replace 'master' once the upgrade is complete. In the mean time how do we keep the 'upgrade' branch in sync with 'master'?

To date I've been rebasing the 'upgrade' branch on 'master' weekly. The problem is that this rewrites history and creates chaos for members in Team B when they want to pull from or push changes to 'upgrade'. How should we continuously integrate 'master' and 'upgrade' in a simple and clean manner?enter image description here

Gazza
  • 3,051
  • 1
  • 20
  • 22

1 Answers1

3

To date I've been rebasing the 'upgrade' branch on 'master' weekly.
The problem is that this rewrites history and creates chaos for members in Team B.

So... don't rebase. Fetch and merge origin/master to the local branch upgrade.
The final merge back to master will be an easy (or even fast-foward) one.

See also:

  • "About Git's merge and rebase": for deliver and rebase basics
  • "git rebase vs git merge": to see the kind of workflow each operation supports.
    Rebase is good just before a merge.
    But in your case, you won't merge (back to master) before a long time.
    So merge (to upgrade) is a sensible solution.
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • 1
    Thanks :) I'm not too excited about the history that merging will produce (which is why we've avoided merging to date), but I what I'm starting to realise is that its one or the other. Appreciate the feedback :) – Gazza Aug 30 '12 at 12:15
  • @Gazza would one extra commit per week would cripple and pollute your history? – VonC Aug 30 '12 at 12:16