REMOVE CONTROLLED

Description

Deletes a file or directory from version control.

Usage

cm remove | rm <item_path>[ ...] [--format=<str_format>] [--errorformat=<str_format>] [--nodisk]

Options

Option / ArgumentDescription
--formatRetrieves the output progress message in a specific format. See the Examples for more information.
--errorformatRetrieves the error message (if any) in a specific format. See the Examples for more information.
--nodiskRemoves from version control, but keeps the item on disk.
item_pathItems path to remove. Use double quotes (" ") to specify paths containing spaces. Use a whitespace to separate paths.

Help

Remarks

Items are deleted from disk. Removed items are removed from the parent directory in the source code control.

Requirements

  • The item must be under source code control.

Reading input from stdin

The 'remove' command can read paths from stdin. To do this, pass a single dash "-". Example: cm remove -

Paths will be read until an empty line is entered. This allows you to use pipe to specify which files to remove. Example:

dir /S /B *.c | cm remove -

(In Windows, removes all .c files in the workspace.)

Examples

cm remove src

(Removes 'src'. If src is a directory, this is the same as 'cm remove -R src'.)

cm remove c:\workspace\file.txt --format="{0} - REMOVED" --errorformat="{0} - ERROR REMOVING"

(Removes 'file.txt' from version control and from disk, writing "c:\workspace\file.txt - REMOVED" if the operation succeeded, or "c:\workspace\file.txt - ERROR REMOVING" otherwise.)

cm remove c:\workspace\file.txt --nodisk

(Removes 'file.txt' from version control, but keeps it on disk.)