Installation

Installation#

Mercurial is written in Python, C and Rust with platform independence in mind. As a result, Mercurial is available on Microsoft Windows, GNU/Linux, macOS, Solaris 11 Express and others. You can either download a binary package for the system of your choice or build from source.

For those looking for the utmost performance, a growing part of Mercurial is being written in Rust. For more information, see Rust in Mercurial.

Windows users are likely to enjoy the TortoiseHg GUI the most, which integrates Mercurial directly into File Explorer.

Packages for common Linux and BSD distributions can be installed from the system specific repositories:

apt install mercurial
dnf install mercurial
pacman -S mercurial
emerge mercurial
brew install mercurial

Binary packages can be installed using pkg:

pkg install mercurial

Alternatively, you can install from source via the ports collection:

cd /usr/ports/devel/mercurial
make install

Using the winget package manager:

winget install Mercurial.Mercurial -e

Or download from the list of binary releases.

Using the winget package manager:

winget install TortoiseHg.TortoiseHg -e

Or download from the list of binary releases.

Note

If you want to build Mercurial from source, you still need hg installed, but not system-wide: your system Python needs to not have Mercurial installed. Use one of the methods below to install Mercurial instead.

Mercurial is available on PyPI as wheels and sdist, so one can install the last stable version with any PyPI front-ends (like UV, pipx, pip, …):

uv tool install mercurial
pipx install mercurial

Note

On Debian/Ubuntu, make sure your pipx install matches your Python and pip installs: for instance if you used apt to install Python, also use it to for pipx and pip.

pip install mercurial

Finally, the Mercurial conda-forge package can be installed as a global tool with Miniforge or Pixi:

conda activate base
pip install conda-app
conda-app install mercurial
pixi global install mercurial

Installing Third Party Extensions#

Some third party extensions are available on PyPI (usually with a hg- prefix in the name).

uv tool install mercurial --with hg-evolve --with hg-git
pipx inject mercurial hg-evolve hg-git

Extensions installed that way will still need to be enabled from the configuration.