The "Master branch" is for a product which is ready and can be downloaded by end-users.
But there are "release branches" - I have no ideas who these branches are for. Release for customers? For QA?
Image showing the branches
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.
A branch in Git is simply a lightweight movable pointer to one of these commits. The default branch name in Git is master . As you start making commits, you're given a master branch that points to the last commit you made. Every time you commit, the master branch pointer moves forward automatically.
The release branch represents a complete feature set. The only commits on the release branch are for bug fixes and important chores. The Gitflow release branch is created off the development branch. Gitflow release is merged into master and also back into development.
I would agree that you don't need the 'master' branch. You can delete it, and then may want to consider renaming the 'develop' branch to 'master' or 'trunk'. That gives you something like the the 'Branch for release' strategy described on the Trunk Based Development website.
Once develop
has acquired enough features for a release (or a predetermined release date is approaching), you fork a release branch off of develop. Creating this branch starts the next release cycle, so no new features can be added after this point.Only bug fixes, documentation generation, and other release-oriented tasks should go in this branch(which includes testing also). Once it's ready to ship, the release gets merged into master and tagged with a version number. In addition, it should be merged back into develop, which may have progressed since the release was initiated.
Using a dedicated branch to prepare releases makes it possible for one team to polish the current release while another team continues working on features for the next release. It also creates well-defined phases of development (e.g., it's easy to say, “this week we're preparing for version 4.0” and to actually see it in the structure of the repository).
More info here for branches
As explained in the original post by V.Driessen :
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. This means mainly bug fixing, documentation, etc as pointed out by minas.
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