Skip to content

Instantly share code, notes, and snippets.

@rajanand02
Last active October 30, 2015 12:55
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 rajanand02/9dce82790d153f286773 to your computer and use it in GitHub Desktop.
Save rajanand02/9dce82790d153f286773 to your computer and use it in GitHub Desktop.
Mercurial handbook

Mercurial Handbook

Clone

hg clone <repo url>

Create a branch

hg branch <branch name>

Add files

hg add filename

Check status

hg status

Commit changes

hg commit

Commit selected files

hg commit file1 file2 dir/

Pull

hg pull branchname

Rebase

hg pull --rebase <branchname>

Merge a branch

hg merge <branchname>

Push

hg push -r . # to push only the current branch changes

hg push # to push all branches

Close a branch

hg commit --close-branch -m “close commit”

Show current branch

hg branch

Show all branches

hg branches

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment