Mercurial

Pulkit Goyal

Contributor to Mercurial

Fast, powerful and easy to learn version control system.

Lets get our hands dirty!

Initialising a repository

  $ hg init

To make Mercurial start tracking your files, you need to add them.

  $ touch a
  $ hg add a
  adding a

Committing changes

There is no staging area like Git.

  $ hg commit
  $ hg commit -i

Commands to look into history

  • hg log
  • hg heads
  • hg annotate etc.

Enabling Extensions

There are lot of extensions shipped with core which are easy to use.

Things like rebase, histedit, strip, blackbox are shipped as extensions.

Add this in your hgrc file to enable an extension.

[extensions]
<extension name> = <path to extension>

For extensions shipped with core, the path will be ''.

History Editing with Mercurial

hg rebase

Easy to use, not scary like Git.

Evolve Extension

A very powerful, trouble free history editing extension.

hg absorb

An amazing extension which automatically add changes to correct place in the history.

More powerful tools to help you.

revsets

Mercurial supports a functional language for selecting a set of revisions.
    Expressions in this language are called revsets.

filesets

Mercurial also supports a functional language for selecting a set of files.

Questions

Thanks!

Mercurial

By Pulkit Goyal

Mercurial

  • 1,320