6 git-rm - Remove files from the working tree and from the index.
10 'git-rm' [-f] [-n] [-v] [--] <file>...
14 A convenience wrapper for git-update-index --remove. For those coming
15 from cvs, git-rm provides an operation similar to "cvs rm" or "cvs
22 Files to remove from the index and optionally, from the
26 Remove files from the working tree as well as from the index.
29 Don't actually remove the file(s), just show if they exist in
36 This option can be used to separate command-line options from
37 the list of files, (useful when filenames might be mistaken
38 for command-line options).
44 The list of <file> given to the command is fed to `git-ls-files`
45 command to list files that are registered in the index and
46 are not ignored/excluded by `$GIT_DIR/info/exclude` file or
47 `.gitignore` file in each directory. This means two things:
49 . You can put the name of a directory on the command line, and the
50 command will remove all files in it and its subdirectories (the
51 directories themselves are never removed from the working tree);
53 . Giving the name of a file that is not in the index does not
59 git-rm Documentation/\\*.txt::
61 Removes all `\*.txt` files from the index that are under the
62 `Documentation` directory and any of its subdirectories. The
63 files are not removed from the working tree.
65 Note that the asterisk `\*` is quoted from the shell in this
66 example; this lets the command include the files from
67 subdirectories of `Documentation/` directory.
71 Remove all git-*.sh scripts that are in the index. The files
72 are removed from the index, and (because of the -f option),
73 from the working tree as well. Because this example lets the
74 shell expand the asterisk (i.e. you are listing the files
75 explicitly), it does not remove `subdir/git-foo.sh`.
83 Written by Linus Torvalds <torvalds@osdl.org>
87 Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
91 Part of the gitlink:git[7] suite