gitflow model

23
Time release branches master develop hotxes feature 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: hotx 0.2 Bugxes from rel. branch may be continuously merged back into develop Tag 0.1 Tag 0.2 Incorporate bugx in develop Only bugxes! Start of release branch for 1.0 Author: Vincent Driessen Original blog post: http://nvie.com/archives/323 License: Creative Commons

Upload: kenziii

Post on 05-Dec-2014

675 views

Category:

Technology


1 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Gitflow Model

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

Page 2: Gitflow Model

The main branches

• Branches

‣ master

‣ develop

Page 3: Gitflow Model

The main branches

• Lifetime

‣ infinite

• Usage

• master -> production-ready

• develop -> latest for next release

Page 4: Gitflow Model

Time

masterdevelop

Tag

0.1

initial git to create develop branch, start development

Page 5: Gitflow Model

Supporting branches

• Branches

‣ feature

‣ release

‣ hotfix

Page 6: Gitflow Model

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

Page 7: Gitflow Model

Feature branches

• Create a feature branch

• When starting work on a new feature, branch off from the develop branch

• $ git checkout -b myfeature develop

Page 8: Gitflow Model

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

Page 9: Gitflow Model

Feature branches• The --no-ff flag avoids losing information

about the historical existence of a feature

Page 10: Gitflow Model

Time

masterdevelopfeature

branches

Feature for future

release

Major feature for

next release

Tag

0.1

create feature/* branches to start new features

Page 11: Gitflow Model

Time

masterdevelopfeature

branches

Feature for future

release

Major feature for

next release

Tag

0.1

when finish develop features, merge back to develop branch

Page 12: Gitflow Model

Time

masterdevelop

Tag

0.1

delete feature branches

Page 13: Gitflow Model

Release branches

• May branch off from: develop

• Must merge back into: develop and master

• Branch naming convention: release/*

Page 14: Gitflow Model

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

Page 15: Gitflow Model

Time

release branches masterdevelop

Tag

0.1

Tag

0.2

Start of release

branch for1.0

create release/* branch to ready to release

Page 16: Gitflow Model

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

Page 17: Gitflow Model

Time

masterdevelop

Tag

1.0

Tag

0.1

Tag

0.2

delete release/* branch

Page 18: Gitflow Model

Hotfix branches

• May branch off from: master

• Must merge back into: develop and master

• Branch naming convention: hotfix/*

Page 19: Gitflow Model

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

Page 20: Gitflow Model

Time

masterdevelop hot!xes

Severe bug !xed for

production:hot!x 0.2

Tag

0.1

create hotfix/* branch to fix bugs

Page 21: Gitflow Model

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

Page 22: Gitflow Model

Time

masterdevelop

Tag

0.1

Tag

0.2

delete hotfix/* branches

Page 23: Gitflow Model

Refernce

• http://bit.ly/gitflow-1