git rm [-f | --force] [-n] [-r] [--cached] [--ignore-unmatch] [--quiet] [--] <file>...
Remove files from the index, or from the working tree and the index. git-rm will not remove a file from just your working directory. (There is no option to remove a file only from the work tree and yet keep it in the index; use /bin/rm if you want to do that.) The files being removed have to be identical to the tip of the branch, and no updates to their contents can be staged in the index, though that default behavior can be overridden with the -f option. When --cached is given, the staged content has to match either the tip of the branch or the file on disk, allowing the file to be removed from just the index.
<file>...
-f, --force
-n, --dry-run
-r
--
--cached
--ignore-unmatch
-q, --quiet
git-rm normally outputs one line (in the form of an "rm" command) for each file removed. This option suppresses that output.
The <file> list given to the command can be exact pathnames, file glob patterns, or leading directory names. The command removes only the paths that are known to git. Giving the name of a file that you have not told git about does not remove that file.
File globbing matches across directory boundaries. Thus, given two directories oqd` and d2, there is a difference between using git rm 'd*cq and oqgit rm 'd/\*\cq, as the former will also remove all of directory `d2.
git rm Documentation/\\*.txt
Note that the asterisk \* is quoted from the shell in this example; this lets git, and not the shell, expand the pathnames of files and subdirectories under the Documentation/ directory.
git rm -f git-*.sh
git-add(1)
Written by Linus Torvalds <m[blue]torvalds@osdl.orgm[][1]>
Documentation by Junio C Hamano and the git-list <m[blue]git@vger.kernel.orgm[][2]>.
Part of the git(1) suite