Show Menu
Cheatography

Mercurial workflow Cheat Sheet by

Workflow based on http://nvie.com/posts/a-successful-git-branching-model/

Hotfix branches

May branch off from:
default

Must merge back into:
dev
and
default

Branch naming conven­tion:
hotfix-*
Creating the hotfix branch:
> hg up default

> hg branch hotfix­-1.2.1

> ./bump­-ve­rsi­on.sh 1.2.1

> hg commit -m "­Bumped version number to 1.2.1"

> ./bugfix

> hg commit -m "­Fixed severe production proble­m"


Finishing a hotfix branch:
> hg up default

> hg merge hotfix­-1.2.1

> hg tag 1.2.1

> hg com

> hg up dev

> hg merge hotfix­-1.2.1

> hg com

> hg up hotfix­-1.2.1

> hg com -m "­closing branch­" --clos­e-b­ranch
 

Feature branches

May branch off from:
dev

Must merge back into:
dev

Branch naming conven­tion:
anything except
default
,
dev
,
release-
, or
hotfix-
Creating a feature branch:
> hg up dev

> hg branch myfeature


Incorp­orating a finished feature on develop:
> hg up dev

> hg pull

> hg merge myfeature

> hg com -m "­Merge myfeat­ure­"

> hg up myfeature

> hg com -m "­closing branch­" --clos­e-b­ranch

> hg up dev

> hg push






-
 

Release branches

May branch off from:
dev

Must merge back into:
dev and default

Branch naming conven­tion:
release-*
Creating a release branch:
> hg up dev

> hg branch releas­e-1.2

> ./bump­-ve­rsi­on.sh 1.2

> hg commit -m "­Bumped version number to 1.2"


Finishing a release branch:
> hg up default

> hg merge releas­e-1.2

> hg tag 1.2

> hg com

> hg up dev

> hg merge releas­e-1.2

> hg com

> hg up releas­e-1.2

> hg com -m "­closing branch­" --clos­e-b­ranch









-
       
 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          Mercurial (Hg) Cheat Sheet
          Weights and Measures Cheat Sheet