Chapter 2. A Tour of Mercurial: The Basics

Installing Mercurial on Your System

Prebuilt binary packages of Mercurial are available for every popular operating system. These make it easy to start using Mercurial on your computer immediately.


The best version of Mercurial for Windows is TortoiseHg, which can be found at This package has no external dependencies; it just works. It provides both command-line and graphical user interfaces.

Mac OS X

Lee Cantey publishes an installer of Mercurial for Mac OS X at


Because each Linux distribution has its own packaging tools, policies, and rate of development, it’s difficult to give a comprehensive set of instructions on how to install Mercurial binaries. The version of Mercurial that you will end up with can vary depending on how active the person is who maintains the package for your distribution.

To keep things simple, I will focus on installing Mercurial from the command line under the most popular Linux distributions. Most of these distributions provide graphical package managers that will let you install Mercurial with a single click; the package name to look for is mercurial.

  • Ubuntu and Debian:

    apt-get install mercurial
  • Fedora:

    yum install mercurial
  • OpenSUSE:

    zypper install mercurial
  • Gentoo:

    emerge mercurial


SunFreeWare, at, provides prebuilt packages of Mercurial.

Getting Started

To begin, we’ll use the hg version command ...

Get Mercurial: The Definitive Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.