Skip to content

Instantly share code, notes, and snippets.

@jamesmichiemo
Created April 7, 2013 08:23
Show Gist options
  • Save jamesmichiemo/5329559 to your computer and use it in GitHub Desktop.
Save jamesmichiemo/5329559 to your computer and use it in GitHub Desktop.
Useful Commands for Mercurial
//Mercurial commands for Terminal
# NOTES: Lines starting with // or # are comments and should not be typed into terminal.
#For additional help use the wiki at http://mercurial.selenic.com/wiki/
//Help for Commands
#<command> help:
$ hg help <command>
or
$ hg <command> - -help
//Standard Commands from add to push (in order)
#add files and folders that contain files to be commited:
$ hg add .
or
$ hg add <filename1, filename2, ...>
#show changes to be commited:
$ hg status
#commit all added items to the staging area with a detail message:
$ hg commit -m 'add descriptive commit message'
#push local repo to remote:
$ hg push
//Setting up a New Repo
# change terminal's directory to that of your local repository folder
$ cd /path/to/folder/of/your/files/
#new repository command:
$ hg init <path>
#copy repo from an existing repo:
$ hg clone <sourcePath> [<destinationPath>]
//Misc
#create new branch:
$ hg branch <branchName>
$ hg commit -m "add <branchName> branch"
#change to specific branch:
$ hg update <branchName>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment