0

I'm getting a strange behavior when merging a hotfix into the develop branch. It rearranges all the release branches into the develop branch.

Is it right?

Here is a example

Before merging the hotfix

enter image description here

After merging the hotfix

enter image description here

  • This is what `git merge` does. If you only need to merge some commits, use `git cherry-pick` instead. – ElpieKay Jun 09 '16 at 12:01
  • 1
    You have lots of release branches merged to your hotfix branch, so what exactly do you expect that should happen when you merge hotfix to develop? Also, please define `re-apply` – CptBartender Jun 09 '16 at 12:02
  • @CptBartender It's a default git flow process, all those release branches are already merged into develop – Jonas Schumacher Jun 09 '16 at 12:30
  • I think that it's not a technical problem, but the graphic looks very weird... It could be just a optimization from git – Jonas Schumacher Jun 09 '16 at 12:45
  • 1
    I still don't see where the actual problem is, and I still don't get what you mean by `re-apply` – CptBartender Jun 09 '16 at 14:30
  • 1
    Even if your `release/*` branches were merged properly into the `develop` branch (possibly hidden from the diagram), your `develop` branch is definitely missing the merge commits generated from merging the `release/*` branches into `master`. This is why I prefer to merge `master` to `develop` after a release, instead of merging `release/x` to `develop` and `master` separately. – Cody Stott Jun 09 '16 at 15:07
  • @CptBartender You're right, re-apply is not the right word, maybe re-arrange – Jonas Schumacher Jun 09 '16 at 15:56
  • I added a larger picture and the state before merging as well – Jonas Schumacher Jun 09 '16 at 16:06
  • @CodyStott Hmm, I think that I get it... Before merging the hotfix, the develop branch doesn't know anything about master... So, because the hotfix start at the master branch, it needs to add the commit "merge release into master", even if it didn't change any file – Jonas Schumacher Jun 09 '16 at 16:12
  • 1
    @JonasSchumacher that's pretty much correct, but remember that merging never _creates_ (non-merge) commits, it just joins 2 branches of commits together. Git history is not linear by any means. – Cody Stott Jun 09 '16 at 16:17
  • @CptBartender Now I see, it's not reapply neither rearrange, the commit "merge release into master" never was into develop – Jonas Schumacher Jun 09 '16 at 16:18

0 Answers0