Mercurial Distributed SCM

Commands

Repository creation

clone:make a copy of an existing repository
init:create a new repository in the given directory

Remote repository management

incoming:show new changesets found in source (aliases: in)
outgoing:show changesets not found in the destination (aliases: out)
paths:show aliases for remote repositories
pull:pull changes from the specified source
push:push changes to the specified destination
serve:start stand-alone webserver

Change creation

commit:commit the specified files or all outstanding changes (aliases: ci)

Change manipulation

backout:reverse effect of earlier changeset
graft:copy changes from other branches onto the current branch
merge:merge another revision into working directory

Change organization

bookmarks:create a new bookmark or list existing bookmarks (aliases: bookmark)
branch:set or show the current branch name
branches:list repository named branches
phase:set or show the current phase name
tag:add one or more tags for the current or given revision
tags:list repository tags

File content management

annotate:show changeset information by line for each file (aliases: blame)
cat:output the current or given revision of files
copy:mark files as copied for the next commit (aliases: cp)
diff:diff repository (or selected files)
grep:search for a pattern in specified files

Change navigation

bisect:subdivision search of changesets
heads:show branch heads
identify:identify the working directory or specified revision (aliases: id)
log:show revision history of entire repository or files (aliases: history)

Working directory management

add:add the specified files on the next commit
addremove:add all new files, delete all missing files
files:list tracked files
forget:forget the specified files on the next commit
purge:removes files not tracked by Mercurial (aliases: clean)
remove:remove the specified files on the next commit (aliases: rm)
rename:rename files; equivalent of copy + remove (aliases: move, mv)
resolve:redo merges or set/view the merge status of files
revert:restore files to their checkout state
root:print the root (top) of the current working directory
shelve:save and set aside changes from the working directory
status:show changed files in the working directory (aliases: st)
summary:summarize working directory state (aliases: sum)
unshelve:restore a shelved change to the working directory
update:update working directory (or switch revisions) (aliases: up, checkout, co)

Change import/export

archive:create an unversioned archive of a repository revision
bundle:create a bundle file
export:dump the header and diffs for one or more changesets
import:import an ordered set of patches (aliases: patch)
unbundle:apply one or more bundle files

Repository maintenance

admin::verify:verify the integrity of the repository
manifest:output the current or given revision of the project manifest
recover:roll back an interrupted transaction
verify:verify the integrity of the repository

Help

config:show combined config settings from all hgrc files (aliases: showconfig, debugconfig)
help:show help for a given topic or a help overview
version:output version and copyright information

Additional Help Topics

Mercurial identifiers

filesets:Specifying File Sets (aliases: fileset)
hgignore:Syntax for Mercurial Ignore Files (aliases: ignore)
patterns:File Name Patterns
revisions:Specifying Revisions (aliases: revs, revsets, revset, multirevs, mrevs)
urls:URL Paths

Mercurial output

color:Colorizing Outputs
dates:Date Formats
diffs:Diff Formats
templating:Template Usage (aliases: templates, template, style)

Mercurial configuration

config:Configuration Files (aliases: hgrc)
environment:Environment Variables (aliases: env)
extensions:Using Additional Features
flags:Command-line flags
hgweb:Configuring hgweb
merge-tools:Merge Tools (aliases: mergetools, mergetool)
pager:Pager Support
rust:Rust in Mercurial (aliases: rustext, rhg)

Concepts

bundlespec:Bundle File Formats
evolution:Safely rewriting history (EXPERIMENTAL)
glossary:Glossary
phases:Working with Phases
subrepos:Subrepositories (aliases: subrepo)

Miscellaneous

deprecated:Deprecated Features
internals:Technical implementation topics
scripting:Using Mercurial from scripts and automation

Extensions

acl

hooks for controlling repository access

blackbox

log repository events to a blackbox for debugging

blackbox:view the recent repository events

bugzilla

hooks for integrating with the Bugzilla bug tracker

censor

erase file content at a given revision

censor:(no help text available)

churn

command to display statistics about repository history

churn:histogram of changes to the repository

clonebundles

advertise pre-generated bundles to seed clones

admin::clone-bundles-clear:
 remove existing clone bundle caches
admin::clone-bundles-refresh:
 generate clone bundles according to the configuration

closehead

close arbitrary heads without checking them out first

close-head:close the given head revisions

convert

import revisions from foreign VCS repositories into Mercurial

convert:convert a foreign SCM repository to a Mercurial one.

eol

automatically manage newlines in repository files

extdiff

command to allow external programs to compare revisions

extdiff:use external program to diff repository (or selected files)

factotum

http authentication with factotum

fastexport

export repositories as git fast-import stream

fastexport:export repository as git fast-import stream

githelp

try mapping git commands to Mercurial commands

githelp:suggests the Mercurial equivalent of the given git command

gpg

commands to sign and verify changesets

sigcheck:verify all the signatures there may be for a particular revision
sign:add a signature for the current or given revision
sigs:list signed changesets

hgk

browse the repository in a graphical way

view:start interactive history viewer

highlight

syntax highlighting for hgweb (requires Pygments)

histedit

interactive history editing

histedit:interactively edit changeset history

keyword

expand keywords in tracked files

kwdemo:print [keywordmaps] configuration and an expansion example
kwexpand:expand keywords in the working directory
kwfiles:show files configured for keyword expansion
kwshrink:revert expanded keywords in the working directory

largefiles

track large binary files

lfconvert:convert a normal repository to a largefiles repository
lfpull:pull largefiles for the specified revisions from the specified source

mq

manage a stack of patches

qapplied:print the patches already applied
qclone:clone main and patch repository at same time
qcommit:commit changes in the queue repository (DEPRECATED)
qdelete:remove patches from queue
qdiff:diff of the current patch and subsequent modifications
qfinish:move applied patches into repository history
qfold:fold the named patches into the current patch
qgoto:push or pop patches until named patch is at top of stack
qguard:set or print guards for a patch
qheader:print the header of the topmost or specified patch
qimport:import a patch or existing changeset
qinit:init a new queue repository (DEPRECATED)
qnew:create a new patch
qnext:print the name of the next pushable patch
qpop:pop the current patch off the stack
qprev:print the name of the preceding applied patch
qpush:push the next patch onto the stack
qqueue:manage multiple patch queues
qrefresh:update the current patch
qrename:rename a patch
qrestore:restore the queue state saved by a revision (DEPRECATED)
qsave:save current queue state (DEPRECATED)
qselect:set or print guarded patches to push
qseries:print the entire series file
qtop:print the name of the current patch
qunapplied:print the patches not yet applied

notify

hooks for sending email push notifications

patchbomb

command to send changesets as (a series of) patch emails

email:send changesets by email

rebase

command to move sets of revisions to a different ancestor

rebase:move changeset (and descendants) to a different branch

schemes

extend schemes with shortcuts to repository swarms

share

share a common history between several working directories

share:create a new shared repository
unshare:convert a shared repository to a normal one

transplant

command to transplant changesets from another branch

transplant:transplant changesets from another branch

win32mbcs

allow the use of MBCS paths with problematic encodings

zeroconf

discover and advertise repositories on the local network

Advanced Extensions

commitextras

adds a new flag extras to commit (ADVANCED)

Experimental Extensions

absorb

apply working directory changes to changesets (EXPERIMENTAL)

absorb:incorporate corrections into the stack of draft changesets

amend

provide the amend command (EXPERIMENTAL)

amend:amend the working copy parent with all or specified outstanding changes

automv

check for unrecorded moves at commit time (EXPERIMENTAL)

beautifygraph

beautify log -G output by using Unicode characters (EXPERIMENTAL)

bookflow

implements bookmark-based branching (EXPERIMENTAL)

fastannotate

yet another annotate implementation that might be faster (EXPERIMENTAL)

fix

rewrite file content in changesets or working copy (EXPERIMENTAL)

fix:rewrite file content in changesets or working directory

fsmonitor

Faster status operations with the Watchman file monitor (EXPERIMENTAL)

git

grant Mercurial the ability to operate on Git repositories. (EXPERIMENTAL)

hooklib

collection of simple hooks for common tasks (EXPERIMENTAL)

journal

track previous positions of bookmarks (EXPERIMENTAL)

journal:show the previous position of bookmarks and the working copy

lfs

lfs - large file support (EXPERIMENTAL)

logtoprocess

send ui.log() data to a subprocess (EXPERIMENTAL)

narrow

create clones which fetch history data for subset of files (EXPERIMENTAL)

tracked:show or change the current narrowspec

phabricator

simple Phabricator integration (EXPERIMENTAL)

phabimport:import patches from Phabricator for the specified Differential Revisions
phabread:print patches from Phabricator suitable for importing
phabsend:upload changesets to Phabricator
phabupdate:update Differential Revision in batch

releasenotes

generate release notes from commit messages (EXPERIMENTAL)

releasenotes:parse release notes from commit messages into an output file

remotefilelog

remotefilelog causes Mercurial to lazilly fetch file contents (EXPERIMENTAL)

gc:garbage collect the client and server filelog caches
prefetch:prefetch file revisions from the server
repack:(no help text available)
verifyremotefilelog:
 (no help text available)

remotenames

showing remotebookmarks and remotebranches in UI (EXPERIMENTAL)

show

unified command to show various repository information (EXPERIMENTAL)

show:show various repository information

sparse

allow sparse checkouts of the working directory (EXPERIMENTAL)

split

command to split a changeset into smaller ones (EXPERIMENTAL)

split:split a changeset into smaller ones

sqlitestore

store repository data in SQLite (EXPERIMENTAL)

uncommit

uncommit part or all of a local changeset (EXPERIMENTAL)

unamend:undo the most recent amend operation on a current changeset
uncommit:uncommit part or all of a local changeset

Deprecated Extensions

children

command to display child changesets (DEPRECATED)

children:show the children of the given or working directory revision

fetch

pull, update and merge in one command (DEPRECATED)

fetch:pull changes from a remote repository, merge new changes if needed.

graphlog

command to view revision graphs from a shell (DEPRECATED)

glog:show revision history alongside an ASCII revision graph

pager

browse command output with an external pager (DEPRECATED)

purge

command to delete untracked files from the working directory (DEPRECATED)

record

commands to interactively select changes for commit/qrefresh (DEPRECATED)

qrecord:interactively record a new patch
record:interactively select changes to commit

strip

strip changesets and their descendants from history (DEPRECATED)

win32text

perform automatic newline conversion (DEPRECATED)