1

I'm asking myself how manage branching by release and hotfixes.

For example, if we have a main branch, a release branch V1, and a release branch V2 and development branch for each release branch(developmet V1 and V2) and we find a bug in the release branch V1. We have to develop a hotfix, but how merge this hotfix in the release branch V2 and the development branch. Like that : release V1 to Main to release V2 and main to development V1 and V2 ?

If I merge like that, release to release V2 is out of date ?

But how manage the main branch ? Should it not be as stable as possible ? And how this main branch is manage because there is a lot of merge so which version of developpement is in main ?

With this pattern I will cover cases where customers can have differents versions of a product.

Thanks.

enter image description here

bobosh
  • 425
  • 5
  • 21

1 Answers1

1

You do that in following order:

  1. Create hotfix in Release 1 branch
  2. Merge it to Main
  3. Merge it to Release 2
  4. Merge it to whatever Development branches you have

(of course, there is a stabilization after each merge)

But how manage the main branch ? Should it not be as stable as possible ?

Yes, it should. That's why it must be covered with tests.

Sergei Rogovtcev
  • 5,804
  • 2
  • 22
  • 35
  • So you describe it like my image. But if I have new feature in main, when I merge hotfix in release V2, i bring new my feature ? – bobosh Sep 02 '12 at 08:06
  • @bobosh No, you don't. You don't have to merge all changes, you can choose the ones you want. That's called "cherrypicking". – Sergei Rogovtcev Sep 02 '12 at 08:08
  • I can choose only one file ? I hadn't understand that, and informations I found on forum said it was impossible without baseless merge. Thanks for your help. It helps my a lot. – bobosh Sep 02 '12 at 08:13
  • @bobosh You can choose one (or more) *changeset*. – Sergei Rogovtcev Sep 02 '12 at 08:19