1

When working with local topic branches, I always rebase before merging with master so that I get a "clean" fast-forward merge.

I'm now sharing collaborating with somebody, and we chose to do this by pushing the topic branch to the central repository. Is it still safe to rebase this branch on to master? Is there anything I should be wary about?

blockhead
  • 9,655
  • 3
  • 43
  • 69
  • 1
    I was starting to answer, but actually I already did: http://stackoverflow.com/questions/3817967/correct-git-workflow-for-shared-feature-branch – VonC Mar 06 '12 at 12:29
  • What do you do if there is a change in master which is necessary for something in the topic branch? Does one developer cherry-pick the commit(s) in, and then rebase onto the shared feature branch? – blockhead Mar 06 '12 at 12:50

1 Answers1

0

I think it would be a bad idea to rebase branches that are already present on the remote. It will make it harder for other developers to work on that branch.

See Recovering from upstream rebase

I think the better solution would be to simply merge the topic branch once finished into the master branch.


Side note:

The changes you do locally on the topic branch can and maybe should still be rebased. It will create a cleaner history to follow.

AnimiVulpis
  • 2,670
  • 1
  • 19
  • 27