Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why need Develop Branch in GitFlow

Tags:

git

We know git-flow like this enter image description here Source: Vincent Driessen

I don't know why need develop branch, what probles will cause without develop branch ?why not merage feature branches to release branches directly?

like image 786
zpy Avatar asked Jan 05 '17 09:01

zpy


People also ask

Why do we need 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.

Why do we need branching in git?

Why do we need a Branch in Git and Why Branches Are Important? Git branches come to the rescue at many different places during the development of a project. As mentioned above, branches create another line of development that is entirely different or isolated from the main stable master branch.

What is Gitflow branching?

Updated on: 6/17/2022. Git flow is a popular Git branching strategy aimed at simplifying release management, and was introduced by software developer Vincent Driessen in 2010. Fundamentally, Git flow involves isolating your work into different types of Git branches.

What is develop branch in git?

With Git flow, you have two main branches, a master branch and a develop branch. Work is done on the develop branch and when it gets to a stable point, it is merged with the master and tagged with a release number. Alongside the main branches are supporting branches including feature, release, and hotfix.


1 Answers

Actually, I wouldn't say that the given answer properly explains, why the develop branch and the master branch are both needed to achieve a releasable state. The version tags created on each release also reflect the releasable state and in Git you can always create a new branch based on these tags subsequently if needed.

In fact, there are multiple blog posts that criticize the Git Flow model and propose a more convenient branching model, which only uses one main branch, i. e. the "master". Here are the references:

https://reallifeprogramming.com/git-process-that-works-say-no-to-gitflow-50bf2038ccf7 https://www.endoflineblog.com/gitflow-considered-harmful

Thus, the actual answer to this question should be: You don't necessarily need the develop branch if you adapt your workflow as described in the linked posts. Still, you wouldn't merge your features into the release branches, but to the master branch, as you want them to be available in the future versions as well.

like image 197
Jeff S. Avatar answered Sep 17 '22 22:09

Jeff S.