Julian Dm
Julian Dm

Reputation: 430

merging develop to release branch

Maybe an easy question for the more experienced in git to answer but i am struggling for some hours now on this.

I have three branches: Develop, MyBranch & Release.

MyBranch extends Develop and since it was a longer feature, Develop was merged into MyBranch again two times. Release is branched off Develop and Develop is ahead of Release (since we still continue to work on features for the next release).

Now i have to merge MyBranch to Develop and to Release. The Merge to Develop didn't have any problems, but i wasn't sure about the merge to Release. Since develop was merged into MyBranch two times, i could by accident merge changes which are not wanted on release. What do i do? I thought about:

Does this make sense? Hope to hear from you guys

Upvotes: 4

Views: 7193

Answers (1)

VonC
VonC

Reputation: 1329262

So you have:

          r--r--r (release)
         /
--d--d--d---d--d--d--d--d (Develop)
         \   \     \
          \   v     v
          mb--mb----mb--mb--mb--mb--mb

Since develop was merged into MyBranch two times, I could by accident merge changes which are not wanted on release.

Creating a test branch as you describe is a good tactic except it involves reverting merges

Another approach would be to create MyBranchRelease where MyBranch is, then rebase it on top of release, while dropping the two merge commits.

git checkout MyBranch 
git checkout -b MyBranchRelease 
git rebase -i release

Upvotes: 3

Related Questions