How does git flow handle a hotfix after master has move far beyond that release?
Scenario
We need to hotfix a bug in 1.0
Master is far in the future and any merge wouldn't be a fast forward and for fun, let's say would conflict.
Would I merge to release stabilization branch and make new tag? Is that what subsequent hotfixes would use as their starting point?
Maintenance or “hotfix” branches are used to quickly patch production releases. Hotfix branches are a lot like release branches and feature branches except they're based on main instead of develop . This is the only branch that should fork directly off of main .
The Gitflow Workflow defines a strict branching model designed around the project release. This workflow doesn't add any new concepts or commands beyond what's required for the Feature Branch Workflow. Instead, it assigns very specific roles to different branches and defines how and when they should interact.
The release branch helps isolate the development of an upcoming version and the current release. The release branch's lifetime ends when a particular version of a project is released. Once this branch merges into the develop and main branches, it can be deleted.
Git Flow Workflow simplifies parallel development because it isolates the new development from the released project. You can work on any project version. The new development is done in feature branches so it is merged back when the developer is satisfied with the code.
nvie’s section on hotfix branches explains these are…
… very much like release branches in that they are also meant to prepare for a new production release, albeit unplanned.
So, they are meant to be done on the top of the latest master
version, when current stuff in develop
isn't ready for the normal release
cycle.
What you want here for patching an older version is the concept of support
branches, which was discussed a long, long time ago after the initial git flow past was publish but, afaik, never been throughly documented.
The gitflow-avh
tool does seem to support them well, so you might want to explore it in a test repo:
I did find some posts with “information” on support
branches but wasn’t too happy with their explanations… given the lack of information about them, i’ll link them anyway:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With