Skip to content

Instantly share code, notes, and snippets.

@drmalex07
Created March 18, 2014 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drmalex07/9620784 to your computer and use it in GitHub Desktop.
Save drmalex07/9620784 to your computer and use it in GitHub Desktop.
Provide an example workflow with Mercurial branches. #mercurial #hg #scm
#
# Example configuration for .hgrc
#
[extensions]
extdiff=
graphlog=
# Create a new branch and immediately switch to it
hg branch feature-a
# work inside "feature-a" and commit your work
hg commit
# Switch to our default branch (updating also our working copy)
hg update default
# work inside "default" and commit
hg commit
# Switch back to "feature-a"
hg update "feature-a"
# work a little more
hg commit
# Switch to default branch
hg update default
# Preview diffs
hg diff -r default:feature-a # textual
hg extdiff -p meld -r default:feature-a # visual
# Merge with feature-a
hg merge -t meld "feature-a"
hg commit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment