Currently using http://nvie.com/posts/a-successful-git-branching-model/ which has been working out quite well.
One point that I'm not really clear on is how to handle fixes that are done while a release branch is created.
If it was a regular hotfix I would branch off of master, complete the fix, then merge into both master and release. However, if it's a fix to be incorporated into my current release, do I branch off the release then merge back in with a merge object or do I just fix the error on the release branch? Do I increment the version number for each fix I complete on a release branch?
One point that I'm not really clear on is how to handle fixes that are done while a release branch is created.
According to the Git Flow model, hotfixes
arise from the necessity to act immediately upon an undesired state of a live production version.
If, while working on a release branch, you needed a hotfix so badly (e.g. high security risk) that you couldn't wait for the release branch to be completed, Git Flow prescribes that you do the following:
The one exception to the rule here is that, when a release branch currently exists, the hotfix changes need to be merged into that release branch, instead of
develop
. Back-merging the bugfix into the release branch will eventually result in the bugfix being merged intodevelop
too, when the release branch is finished. (If work indevelop
immediately requires this bugfix and cannot wait for the release branch to be finished, you may safely merge the bugfix intodevelop
now already as well.)
(Thanks for correcting me on this; I had completely forgotten about that exception.)
However, if it's a fix to be incorporated into my current release, do I branch off the release then merge back in with a merge object or do I just fix the error on the release branch?
As I understand it, since you wrote
[if] it was a regular hotfix [...]
the fix in question is not very urgent and doesn't qualify as a hotfix. In that case, why not simply do it on the release branch directly? After all, according to the Git Flow model, that's what release branches are for:
Release branches support preparation of a new production release. They allow for last-minute dotting of i’s and crossing t’s. Furthermore, they allow for minor bug fixes and preparing meta-data for a release (version number, build dates, etc.).
Do I increment the version number for each fix I complete on a release branch?
No. The version number is set in stone as soon as the release branch gets created. Fixing something on the latter should not cause that version number to change.