In which branch should a beta release be tagged according to git-flow?
We have a release branch for preparing Version x.0.0
, but before releasing x.0.0
we want to release a beta (x.0.0-beta
). Should the release branch be merged into master
in this case and then be tagged x.0.0-beta
on master
or should this beta release be tagged on the release branch for x.0.0
?
Additional question: Is the procedure for a release candidate (x.0.0-rc1
) the same as for beta?
The release branch derives from the develop branch and merges back into the develop and main branches after completion of a release. By convention, the naming of this branch starts with release/* . This branch is created and used when features are completed and finalized for a versioned release.
A tag represents a version of a particular branch at a moment in time. A branch represents a separate thread of development that may run concurrently with other development efforts on the same code base. Changes to a branch may eventually be merged back into another branch to unify them.
Master is a permanent branch which always reflects a production-ready state. So yes, it is for ready-product which can be downloaded on the market by user. Release is a temporal supporting branch to support preparation of a new production release.
The beta branch is where bug fixes and only bug fixes are committed.
I would suggest that you would place the x.0.0-beta
tag on the release branch, once you are ready to ship the beta version, somewhere. You might actually want to go further and tag it with x.0.0-beta0001
so that you can have multiple beta version, as required.
Once you move closer to the release, you would tag the release branch with the x.0.0-rc1
as required as well.
Then, once you merge the release branch into master, and ultimately back into develop, you would tag the master branch with the final version number.
This approach was taken from the implementation of git-flow in the GitVersion utility, which is documented here:
https://gitversion.net/docs/learn/branching-strategies/gitflow/examples
In my understanding all versions should be merged to and tagged on the master branch. As all Release branches should follow this flow. Semantic versioning should prevent people from updating to the released alpha/beta/RC versions.
This keeps your flow clean and straight forward. I.E. No branches are left open to clean up at a later date. And you always finish release branches in the same way after you've upped version number and tested your code.
You could remove all preliminary tags for a specific version after the real release. Yet again this is to keep your flow clean. As people are probably not going to checkout 'unstable' versions of a full and stable release.
1.2.0-alpha
1.1.0
1.1.0-rc2
1.1.0-rc1
1.0.0
1.0.0-beta1
1.0.0-alpha1
Would become
1.2.0-alpha
1.1.0
1.0.0
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