Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the master branch and release branch for?

Tags:

git

git-flow

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

like image 239
newBike Avatar asked Dec 24 '13 05:12

newBike


People also ask

What is the point of a release branch?

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.

What is the point of the master branch?

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.

What is development branch and what is release branch?

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.

Is Master branch necessary?

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.


2 Answers

simplified git workflow

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

like image 88
minas Avatar answered Sep 24 '22 17:09

minas


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.

like image 23
user2867331 Avatar answered Sep 22 '22 17:09

user2867331