What is the difference between develop vs. feature branch type?
Asked Answered
L

3

38

I read few articles about Git flow best practices. There are many types of git branch (for example: [1], [2]):

+ Master
+ Develop
+ Feature
+ Bug
+ Proof of concept
+ Release
+ Hotfix

What is the difference between types Master vs. Release?

What is the difference between types Feature vs. Develop?

[1] http://nvie.com/posts/a-successful-git-branching-model/

[2] http://developer.exoplatform.org/#id-branching-model

Learn answered 20/9, 2016 at 4:50 Comment(1)
These just appear to be arbitrary, albeit common, names given to Git branches. Typically, master is the main branch ("trunk" in SVN) to which all other branches ultimately get merged. As for the other names, it seems pretty self-explanatory what purpose they serve.Overlap
R
53

For the git workflow, as presented in [1]:

  • feature: All features / new functions / major refactorings are done in feature branches, which branch off and are merged back into the develop branch (usually after some kind of peer review).
  • release: When enough features have accumulated or the next release time frame comes near, a new release branch is branched off develop. It is solely dedicated to testing/bug fixing and any cleanup necessary (e.g. changing some path names, different default values for instrumentation etc.).
  • master Once the QA is satisfied with the quality, the release branch is merged into master (and also back to develop). This is then what is shipped/used by the customers.
  • hotfix If a major problem is found after release, the fix is developed in a hotfix branch, that is branched off the master. Those are the only branches that will ever branch off of master.
  • Note: Any commit in master is a merge commit (either from a release or a hotfix branch) and represents a new release that is shipped to the customer.

Please be aware that this model is mainly meant for a) big software projects that follow b) classic release versioning and c) have a separate QA team. Many popular repositories on GitHub follow a simpler model.

Roque answered 20/9, 2016 at 6:5 Comment(0)
D
15

The difference between master and release is that the master branch is what your customers/users are using. It is the branch actually installed or sold.

In a lot of teams the master branch (usually also named main) is also the release branch. But this is not always the case. In larger companies or companies with a separate test or QA department/team the master branch is the branch that's being sold to customers but the release branch is the one being tested. Note that for some projects running a full test may take a week or more so it makes sense to have a branch that testers can test but is stable (developers don't constantly push updates).

The difference between feature and develop comes from the same reasoning. The develop branch (usually named develop or dev) is the stable developer's branch. In traditional source control software the develop branch is your repo server. It is the branch all developers have in common. It is the branch you start development with.

A feature branch on the other hand is your own personal branch. During development of a feature/story/module you will of course modify the code a lot. And to take advantage of git you should commit early and commit often. But the code you're working on is by definition unstable (not finalized) and may cause breaking changes to other developers. So you develop on your own branch (branched off from develop) until your code is ready to be merged back to develop.

Damnify answered 20/9, 2016 at 5:9 Comment(5)
@MikeMB: Ah, yes. Got it backwardsDamnify
Why not named devel instead of develop as it is a very used abbreviation?Pedaiah
@nowox: There are several common names for the develop branch: dev, develop, main etc. They're all the develop branch. It's a concept. What you name your develop branch is up to youDamnify
Aren't all these conventions (nothing to do with Git per se)? Perhaps explicit mentions of GitFlow (unclear in the question due to spelling).Cotyledon
@PeterMortensen: The question has a git-flow tag which is a workflow (convention) that is generally considered the "standard' workflow for most git projects. Yes, it has nothing to do with git but it has everything to do with git-flow. Read this for the original proposal: nvie.com/posts/a-successful-git-branching-modelDamnify
T
7

Just because no one has said it in a clear statement yet, and this would have answered the question for me...

What is the difference between types Master vs. Release?

What is the difference between types Feature vs. Develop?

There is no difference.

Branch names are conventions established by teams, not rules enforced by git.

Git doesn't care what you call your branches, how many sub branches you create, when you merge them, etc. etc. etc. To Git... a branch is a branch is a branch.

On many teams the names of branches follow a defined convention simply for ease of shared understanding... but as we see so often, your convention doesn't matter to the technology. It takes a human to give a concept meaning, so feel free to name your branches in whatever manner you find meaningful.

Tso answered 21/4, 2020 at 21:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.