Branch Categories:
Main Branch
Supportive Branch
Main Branches
origin/master
- the main branch where the source code of HEAD always reflects a production-ready state.
origin/develop
- the main branch where the source code of HEAD always reflects a state with the latest delivered development changes for the next release.
- When the source code in the develop branch reaches a stable point and is ready to be released, all of the changes should be merged back into master somehow and then tagged with a release number
Feature Branches
- May branch off from:
develop
- Must merge back into:
develop
- are used to develop new features for the upcoming or a distant future release.
- it exists as long as the feature is in development, but will eventually be
- merged back into develop (to definitely add the new feature to the upcoming release) or
- discarded (in case of a disappointing experiment).
Release Branches
- May branch off from:
develop
- Must merge back into:
develop
and master
- support preparation of a new production release
- when develop (almost) reflects the desired state of the new release. At least all features that are targeted for the release-to-be-built must be merged in to develop at this point in time. All features targeted at future releases may not — they must wait until after the release branch is branched off. This is the key moment to branch off a new release branch from develop.
Hotfix Branches
- May branch off from:
master
- Must merge back into:
develop
and master
- much like release branches in that they are also meant to prepare for a new production release, albeit unplanned.
- When a critical bug in a production version must be resolved immediately, a hotfix branch may be branched off from the corresponding tag on the master branch that marks the production version.
- The essence is that work of team members (on the develop branch) can continue, while another person is preparing a quick production fix.