hg-status
Show modified, new, or removed Mercurial files
TLDR
Display the status of changed files
Display only modified files
Display only added files
Display only removed files
Display only deleted (but tracked) files
Display changes in the working directory compared to a specified changeset
Display only files matching a specified glob pattern
Display files, excluding those that match a specified glob pattern
SYNOPSIS
hg status [OPTION]... [FILE]...
PARAMETERS
-0, --print0
end filenames with NUL
-A, --all
show all files under Mercurial control
-a, --added
show only added files
-c, --copies
show source of copies
-d, --deleted
show deleted (tracked but missing) files
-I PATTERN, --include PATTERN
include only files matching PATTERN
-i, --ignored
show ignored files
-m, --modified
show only modified files
-n, --no-status
don't prepend status characters to filenames
-r, --removed
show only removed files
-R REV, --rev REV
compare with revision REV
-S, --subrepos
recurse into subrepositories
-T TEMPLATE, --template TEMPLATE
use custom template
-u, --unknown
show only unknown (untracked) files
-X PATTERN, --exclude PATTERN
exclude files matching PATTERN
DESCRIPTION
The hg status command provides a concise summary of changes in a Mercurial repository's working directory compared to the last commit. It lists files with status indicators such as M for modified, A for added, R for removed, ? for unknown (untracked), I for ignored, and ! for missing (deleted but tracked).
By default, it shows modified, added, removed, missing, unknown, and ignored files, but excludes clean files. Options allow filtering specific types, including all files (-A), or showing copies (-c). It supports revision comparisons (-R REV), pattern inclusion/exclusion (-I, -X), and recursion into subrepos (-S).
This command is vital for developers to inspect pending changes before committing, branching, or pushing. Output can be customized with templates (-T) or formatted for scripting (-0). When no files are specified, it scans the entire working directory; otherwise, it limits to given paths.
CAVEATS
Clean files not shown by default; use -A. Patterns are shell globs. Does not detect uncommitted changes in subrepos without -S.
STATUS LEGEND
M modified
A added
R removed
C clean
! missing
? unknown
I ignored
EXAMPLES
hg status - default summary
hg status -amru - added/modified/removed/unknown
hg status -R 1.0 - changes since rev 1.0
HISTORY
Core Mercurial command since initial release (0.1, 2005) by Matt Mackall; evolved with subrepo support in 1.3 (2009) and templating in later versions.


