Scroll to navigation

HG(REMOVE) HG(REMOVE)

NAME

hg remove - remove the specified files on the next commit

SYNOPSIS

hg remove [OPTION]... FILE...

DESCRIPTION

Schedule the indicated files for removal from the current branch.

This command schedules the files to be removed at the next commit. To undo a remove before that, see hg revert. To undo added files, see hg forget.

-A/--after can be used to remove only files that have already been deleted, -f/--force can be used to force deletion, and -Af can be used to remove files from the next revision without deleting them from the working directory.

The following table details the behavior of remove for different file states (columns) and option combinations (rows). The file states are Added [A], Clean [C], Modified [M] and Missing [!] (as reported by hg status). The actions are Warn, Remove (from branch) and Delete (from disk):

opt/state A C M !
none W RD W R
-f R RD RD R
-A W W W R
-Af R R R R
hg remove never deletes files in Added [A] state from the working directory, not even if --force is specified.

Returns 0 on success, 1 if any warnings encountered.

OPTIONS

record delete for missing files
forget added files, delete modified files
recurse into subrepositories
include names matching the given patterns
exclude names matching the given patterns
do not perform actions, just print output

[+] marked option can be specified multiple times

ALIASES

rm