Mercurial notes

distributed version control system:
   maintain version history
   merge changes between and within files
   peer-to-peer development
   remote server file system management


file manager extension:

Linux packages:
   apt-get install mercurial tortoisehg tortoisehg-nautilus  

Windows: (openssh, mercurial shell)


some shell commands:

   hg init (start archive)
   hg clone (copy archive)
   hg clone -e "ssh_path -i ~/.ssh/key_name" ssh:// local_archive_name
   hg add (add files)
   hg commit -m "message" (alias ci)
   hg revert -a --no-backup (reset file system)
   hg merge (merge diverged versions)
   hg pull (pull from archive)
   hg push (push to archive)
   hg update (update file system, alias up)
   hg update null (alias for creating bare repository)
   hg fetch (pull and update)
   hg log (history)
   hgtk log (history GUI)
   hg status (repository status, alias st)
   hg summary (repository summary, alias sum)
   hg copy (copy versioned file, alias cp)
   hg remove (remove versioned file alias rm)
   hg remove --after (remove deleted files from versioning)
   hg rename (rename versioned file alias mv)
   hg serve (Web server)
   hg convert (import from another repository type)
   hg heads (list repository heads)

~/.hgrc (global) &/or .hg/hgrc (per-archive) configuration:

   username = first_name last_name <user@machine.domain>
   ssh = ssh_command_path -i ~/.ssh/key_name_to_use -C
   editor = name_of_your_editor

   convert =
   fetch =

   changegroup = hg update >&2

public and private keys to ~/.ssh
   note that private key should have permissions so that
   only you can read it

port: ~/.ssh/config
   host server_name
   port port_number

   file types to ignore