Upload
kenziii
View
675
Download
1
Embed Size (px)
DESCRIPTION
Citation preview
Time
release branches masterdevelop hot!xesfeature
branches
Feature for future
release
Tag
1.0
Major feature for
next release
From this point on, “next release”
means the release after 1.0
Severe bug !xed for
production:hot!x 0.2
Bug!xes from rel. branch
may be continuously merged back into develop
Tag
0.1
Tag
0.2
Incorporate bug!x in develop
Only bug!xes!
Start of release
branch for1.0
Author: Vincent DriessenOriginal blog post: http://nvie.com/archives/323License: Creative Commons
The main branches
• Branches
‣ master
‣ develop
The main branches
• Lifetime
‣ infinite
• Usage
• master -> production-ready
• develop -> latest for next release
Time
masterdevelop
Tag
0.1
initial git to create develop branch, start development
Supporting branches
• Branches
‣ feature
‣ release
‣ hotfix
Feature branches
• May branch off from: develop
• Must merge back into: develop
• Branch naming convention: anything except master, develop, release/*, hotfix/*
• Typically exist in developer repos only, not in origin
Feature branches
• Create a feature branch
• When starting work on a new feature, branch off from the develop branch
• $ git checkout -b myfeature develop
Feature branches
• Incorporating a finished feature on develop
• merge into the develop branch
• $ git checkout develop
• $ git merge --no-ff myfeature
• $ git branch -d myfeature
• $ git push origin develop
Feature branches• The --no-ff flag avoids losing information
about the historical existence of a feature
Time
masterdevelopfeature
branches
Feature for future
release
Major feature for
next release
Tag
0.1
create feature/* branches to start new features
Time
masterdevelopfeature
branches
Feature for future
release
Major feature for
next release
Tag
0.1
when finish develop features, merge back to develop branch
Time
masterdevelop
Tag
0.1
delete feature branches
Release branches
• May branch off from: develop
• Must merge back into: develop and master
• Branch naming convention: release/*
Release branches
• Creating a release branch
• $ git checkout -b release/1.2 develop
• Finishing a release branch
• $ git checkout master
• $ git merge --no-ff release/1.2
• $ git tag -a 1.2
• $ git checkout develop
• $ git merge --no-ff release/1.2
• $ git branch -d release/1.2
Time
release branches masterdevelop
Tag
0.1
Tag
0.2
Start of release
branch for1.0
create release/* branch to ready to release
Time
release branches masterdevelop
Tag
1.0Bug!xes from
rel. branch may be
continuously merged back into develop
Tag
0.1
Tag
0.2
Only bug!xes!
Start of release
branch for1.0
when finish test or fix bugs, merge back to master and develop branches
Time
masterdevelop
Tag
1.0
Tag
0.1
Tag
0.2
delete release/* branch
Hotfix branches
• May branch off from: master
• Must merge back into: develop and master
• Branch naming convention: hotfix/*
Hotfix branches
• Creating the hotfix branch
• $ git checkout -b hotfix/1.2.1 master
• Finishing a hotfix branch
• $ git checkout master
• $ git merge --no-ff hotfix/1.2.1
• $ git checkout develop
• $ git merge --no-ff hotfix/1.2.1
• $ git branch -d hotfix/1.2.1
Time
masterdevelop hot!xes
Severe bug !xed for
production:hot!x 0.2
Tag
0.1
create hotfix/* branch to fix bugs
Time
masterdevelop hot!xes
Severe bug !xed for
production:hot!x 0.2
Tag
0.1
Tag
0.2
Incorporate bug!x in develop
when finish fix bugs, merge back to master and develop branches
Time
masterdevelop
Tag
0.1
Tag
0.2
delete hotfix/* branches