1

The Git flow model is working well for our company so far, but we're wondering about a solution for handling this hypothetical situation. I searched around a bit, but I think my lack of proper terminology for this case might have stymied my Google-fu.

If all your releases must "be from" a merge commit into the master branch, as detailed here:

A successful Git branching model

Then how do you handle a situation in which you release 0.2.0, then 0.3.0, then 0.2.1? At this point must the release be performed from the 0.2.x development branch (assuming one exists, or is created from the 0.2.0 tag)? Certainly you can't merge back into master, as your patch release is probably a good few commits behind.

Is the best solution then, something like:

git checkout tag-release-0.2.0
git checkout -b some-0.2.1-critical-feature
.. (work) ..
git commit
# At this point, the release-0.2.x-branch is the same as the above release tag
git checkout release-0.2.x-branch
# Merge the feature branch into the patch release branch
git merge some-0.2.1-critical-feature
# NOTE here! Release occurs from the patch branch!
git tag tag-release-0.2.1
# Merge patch fixes into develop
git checkout develop
git merge tag-release-0.2.1

Is there a better solution than this? If the RULE is to merge into master to perform a release, won't any patch releases have to take place prior to the next minor/major?

Craig Otis
  • 31,257
  • 32
  • 136
  • 234
  • Similar to my question http://stackoverflow.com/questions/16386323/following-git-flow-how-should-you-handle-a-hotfix-of-an-earlier-release, which still haven't got a really satisfactory answer. – Klas Mellbourn May 20 '13 at 21:27
  • The `git flow support` command I think kind of handles this situation... but I'm not sure it was ever properly finished... – Matt Cooper May 20 '13 at 21:40

0 Answers0