origin/master is the main branch, the source code of HEAD always reflects a production-ready state.
origin/develop, the source code of HEAD reflects a latest delivered development changes for the next release.
when develop branch reaches a stable point and is ready to be released => all of the changes should be merged back into master somehow => then tagged with the release number.
Each time when changes are merged back into master, this is a new production release by definition.We tend to be very strict at this, so that theoretically, we could use a Git hook script to automatically build and roll-out our software to our production servers everytime there was a commit on master.
Support branches
定义
cat
Feature Branches
Release Branches
Hotfix Branches
meaning
Unlike the main branches, these branches have a limited life time, since they will be removed eventally.
Feature Branches
起源和归宿
May branch off from: develop
May merge back into: develop
Branch naming convention: anything except master, develop, release-*, or hotfix-*
目标
Feature branches typically exist in developer repo only, not in origin.
--no-ff标志
the --no-ff flag causes the merge to always create a new commit object, even if the merge could be performed with a fast-forward.
this avoids losing information about the historical existence of a feature branch and groups together all commits that together added the feature.
Release Branch
起源和归宿
May branch off from: develop
May merge back into: master and develop
Branch naming convention: release-*
目标
Release branches support preparation of a new production release.
allow for last minute dotting of i's and costing t's.
allow for minor bug fixes and preparing meta-data for release(version number, build dates, etc.).
Hotfix Branch
起源和归宿
May branch off from: master
May merged back into: master and develop
Branch naming convention: hotfix-*
目标
Hotfix branches are very much like release branches in that they are also meant to prepare for a new production release, albeit unplanned.
hey arise from the necessity to act immediately upon an undesired state of a live production version.
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.
写在开始
Notes - A successful Git branching model
branching strategy
andrelease management
master
develop
Support branches
定义
cat
Feature Branches
Release Branches
Hotfix Branches
meaning
Feature Branches
起源和归宿
develop
develop
master
,develop
,release-*
, orhotfix-*
目标
--no-ff
标志--no-ff
flag causes the merge to always create a new commit object, even if the merge could be performed with a fast-forward.Release Branch
起源和归宿
develop
master
anddevelop
release-*
目标
Hotfix Branch
起源和归宿
master
master
anddevelop
hotfix-*
目标