Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git branching model, what is the benefit of having a development branch?

The following Git branching model seems to be quite widespread. http://nvie.com/posts/a-successful-git-branching-model/

In our current project we do not have a development branch and create feature/bugfix branches off of master and merge them back and tag all the relevant milestones (finished feature/bugfix/release).

So I'm wondering, what the benefits of having a development branch are?

like image 617
Will Avatar asked Jun 27 '13 11:06

Will


People also ask

Why use a develop branch?

Instead of a single main branch, this workflow uses two branches to record the history of the project. The main branch stores the official release history, and the develop branch serves as an integration branch for features. It's also convenient to tag all commits in the main branch with a version number.

What is development branch in Git?

The Git Flow is the most known workflow on this list. It was created by Vincent Driessen in 2010 and it is based in two main branches with infinite lifetime: master — this branch contains production code. All development code is merged into master in sometime. develop — this branch contains pre-production code.

What is the purpose of Git branching strategy?

The GitHub flow branching strategy is a relatively simple workflow that allows smaller teams, or web applications/products that don't require supporting multiple versions, to expedite their work. In GitHub flow, the main branch contains your production-ready code.

What is the best branching strategy in Git?

Build your strategy from these three concepts: Use feature branches for all new features and bug fixes. Merge feature branches into the main branch using pull requests. Keep a high quality, up-to-date main branch.


2 Answers

My understanding is that the development branch is there to keep the master branch clean. In other words, the master branch should contain nothing but release-ready code.

like image 61
Ken Keenan Avatar answered Sep 24 '22 16:09

Ken Keenan


I have had many clients that did things like you as well. In your world, you might not need a development branch. I think you are using master like a development branch, which is fine for you, it seems.

Some organizations have high ceremony, however, and everything requires debate and approval. In those places, the development branch can function as a place where all working code comes together before being split off in to release branches and eventually to master. In the chart you showed, feature branches are where code lives before it is working. The development branch is where it goes once it's fit to associate with well-behaved code. From there, at some point a snapshot from development feeds the release branch, which might remain active for weeks or months while people hem and haw about QA cycles, final feature set, etc. Eventually the release branch is promoted to master, which represents production at all times.

Since your current setup is working for you, however, perhaps that's all you need. It certainly makes for a less cluttered world.

like image 32
Arthur Dent Avatar answered Sep 24 '22 16:09

Arthur Dent