---
name: "cg-rm"
section: "1"
platform: "linux"
package: "cogito"
version: "0.18.2-1"
release: "Debian 4.0 (Etch)"
platforms: ["linux"]
url: "https://new.carta.tech/cg-rm"
---

# cg-rm(1)

remove files from the repository

## NAME

cg-rm - remove files from the repository

## SYNOPSIS

cg-rm \[-a\] \[-f\] \[-n\] \[-r\] FILE....sp

## DESCRIPTION

Takes a list of file names at the command line, and schedules them for removal from the GIT repository at the next commit. Those files are denoted by *D* in the [**cg-status**(1)](/cg-status/1.md) list. You can remove [**cg-add**(1)](/cg-add/1.md)ed files to undo the addition; you can undo removals in an analogous way using [**cg-add**(1)](/cg-add/1.md) and restore files deleted from the working copy using [**cg-restore**(1)](/cg-restore/1.md)..sp

## OPTIONS

- \-a

  Record removal of all files which have been deleted from the working copy. Useful when there were some random files added/removed (e.g. by some third-party application) and you want to get the repository in sync: just use cg-rm -a && cg-add -a.

- \-f

  Also delete the files from the tree physically.

- \-n

  Do not delete the files from the tree physically, if they are still there. So it effectively just makes Cogito to stop caring about the file. This is the default.

- \-r

  If you pass cg-rm this flag and any directory names, it will try to remove files in those directories recursively.

- \-h, --help

  Print usage summary.

- \--long-help

  Print user manual. The same as found in [**cg-rm**(1)](/cg-rm/1.md).

## COPYRIGHT

Copyright © Petr Baudis, 2005.sp

## SEE ALSO

cg-rm is part of [**cogito**(7)](/cogito/7.md), a toolkit for managing [**git**(7)](/git/7.md) trees..sp
