Gitflow feature vs bugfix branch naming [closed]
Asked Answered
S

1

69

While using Gitflow, what is the reason for separating branch naming to feature vs bugfix vs hotfix?

I.e. why not just, for example, instead of:

feature/
bugfix/
hotfix/

Just do:

change/

What does separating by feature/bugfix/hotfix buy?

Sur answered 29/6, 2015 at 21:46 Comment(1)
I don't agree that this is primarily opinion-based. My question was strictly in regards to using Gitflow, not in general.Sur
C
84

Great questions and the answer really depends on how you sort your git. The branching model and gitflow in general is trying to give us some order in the chaos that commits are just after a couple of days.

The image below shows you what they though makes most sense.

(As far as I know it all came from this blog post by Vincent Driessen)

Separating your hotfixes which merge directly into master and your bugfixes which merge into dev makes it easier to go with your product cycle.

The idea is you build your app, create features, make a release candidate (beta test) and then release your app. Hotfixs can be necessary at any time after this. No point in going back all the way to the feature branch and issuing a bug fix there as the feature may already been developed further.

Does that make sense?

enter image description here

Cockshy answered 29/6, 2015 at 22:9 Comment(4)
I thought hotfixes are bug fixes. Is there a difference?Pearce
Well yes. A hotfix is a bugfix under pressure :) when you have to fix something for a release that is already out. You don't go back into your feature branch or submodule and fix it there as this module may already have been developed further for the next release. Think windows XP. Full of hotfixes :)Cockshy
in git-flow 'hotfix' differs from 'feature' in how they are based and where they are merged to when finished (as shown in the model in this answer). 'hotfix' is based on master and is merged into both master and develop when finished. 'feature' is based on develop and is merged into develop when finished. 'bugfix' is not well documented, but I belive it is only semantically different from 'feature'.Curtiscurtiss
bugfix is a git-flow-avh extension which embodies the functionality of working on the green release line in the above diagram. bugfix branches off the release branch and merges to both the release and development branches on finish.Role

© 2022 - 2024 — McMap. All rights reserved.