Hot-fix during the ongoing release – merge or cherry-pick?
We are trying to follow the git flow with SourceTree tool from Attlasian with all its magic buttons like: start/finish feature, start/finish release, start/finish hot-fix. So far so good, everything seems to be logical.
The tiny problem appears when we need to hot fix while we have an ongoing release branch.
- Git-Stash: Is there a way to prevent merge feature to develop without rebase?
- Resolving conflicts in git version control
- Mercurial “server”
- Github pull request shows too many changes/commits
- Git cherry-pick causes merge conflict while merging does not
- How do I do a 'git status' so it doesn't display untracked files without using .gitignore?
So according to the git flow once we are done with the hot fix, the branch of the hot-fix is merged into master and into develop – so the SourceTree does. In a-successful-git-branching-model document is clearly stated, that it is an exceptional situation and you need to merge the hot-fix branch into the master and into the release branch, later on this hot-fix will be merged back into develop.
My problem here is that I don’t want to do this manual merging back and forth, I still want to use the magic buttons from the SourceTree tool.
So what options do I have:
- Cherry picking the hot-fix commit from develop into release brunch – don’t really like it, cause the history is missing
- Merge the whole master branch into release branch – not even sure if it’s a good idea
2 Solutions collect form web for “Hot-fix during the ongoing release – merge or cherry-pick?”
Given that you closed your hotfix branch (and it was merged back into
master), if you don’t want to cherry pick the commit, I would consider just merging
develop branch into your
release branch (have a look first at what else has happened on
develop since you started the
If you want to do this exclusively via the magic buttons (no command line or manual merges) and are happy to bump another version number, you can just finish your release (merges onto master and also onto development, after your hotfix), and start a new release.
I realised what was my problem. The flow we were using wasn’t a pure git-flow. According to the git-flow the next release is in develop branch, once it’s stable and ready to be released, a short-living(a matter of minutes) release branch is created for “dotting the i’s”. Right afterwards this branch should be finished with merging it into master branch and into develop.
So, if we strictly follow the git-flow, there will never be a question “merge or cherry-pick during the ongoing release branch”, cause there will be no situation like this.