LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

hg

distributed version control system

TLDR

Initialize repository
$ hg init
copy
Clone repository
$ hg clone [url]
copy
Show status
$ hg status
copy
Add files
$ hg add [files]
copy
Commit changes
$ hg commit -m "[message]"
copy
View log
$ hg log
copy
Pull changes
$ hg pull
copy
Push changes
$ hg push
copy

SYNOPSIS

hg command [options]

DESCRIPTION

Mercurial (hg) is a distributed version control system. It tracks changes in source code and supports branching, merging, and collaboration.Mercurial is similar to Git but with different command syntax and philosophy. It emphasizes simplicity and consistency in its interface.

PARAMETERS

COMMAND

Mercurial command.
init
Create repository.
clone
Clone repository.
status
Show working directory status.
add
Add files.
commit
Commit changes.
log
Show history.
pull
Pull from remote.
push
Push to remote.
-R, --repository REPO
Run as if started in the given repository.
-v, --verbose
Increase amount of output.
-q, --quiet
Suppress output.
--version
Output version information.
--help
Display help information.

CONFIGURATION

Mercurial reads settings from several hgrc files, in order: the system-wide file (e.g. /etc/mercurial/hgrc), the per-user file (~/.hgrc), and the per-repository file (.hg/hgrc). Later files override earlier ones. Common sections include [ui] for username and editor, [paths] for remote aliases, and [extensions] to enable built-in or third-party extensions.

INSTALL

sudo apt install mercurial
copy
sudo dnf install mercurial
copy
sudo pacman -S mercurial
copy
sudo apk add mercurial
copy
sudo zypper install mercurial
copy
brew install mercurial
copy
nix profile install nixpkgs#mercurial
copy

CAVEATS

Less popular than Git. Different workflow. Extension system for features.

HISTORY

Mercurial was created by Matt Mackall in 2005, shortly after Git, as another solution for Linux kernel development.

SEE ALSO

git(1), svn(1), hg-clone(1), hg-commit(1), hg-init(1)

RESOURCES

Copied to clipboard
Kai