@@ -8,16 +8,16 @@ git-rm - Remove files from the working tree and from the index
8
8
SYNOPSIS
9
9
--------
10
10
[verse]
11
- 'git rm' [-f | --force] [-n] [-r] [--cached] [--ignore-unmatch] [--quiet] [--] <file >...
11
+ 'git rm' [-f | --force] [-n] [-r] [--cached] [--ignore-unmatch] [--quiet] [--] <pathspec >...
12
12
13
13
DESCRIPTION
14
14
-----------
15
- Remove files from the index, or from the working tree and the index.
16
- `git rm` will not remove a file from just your working directory.
17
- (There is no option to remove a file only from the working tree
18
- and yet keep it in the index; use `/bin/rm` if you want to do that.)
19
- The files being removed have to be identical to the tip of the branch,
20
- and no updates to their contents can be staged in the index,
15
+ Remove files matching pathspec from the index, or from the working tree
16
+ and the index. `git rm` will not remove a file from just your working
17
+ directory. (There is no option to remove a file only from the working
18
+ tree and yet keep it in the index; use `/bin/rm` if you want to do
19
+ that.) The files being removed have to be identical to the tip of the
20
+ branch, and no updates to their contents can be staged in the index,
21
21
though that default behavior can be overridden with the `-f` option.
22
22
When `--cached` is given, the staged content has to
23
23
match either the tip of the branch or the file on disk,
@@ -26,15 +26,20 @@ allowing the file to be removed from just the index.
26
26
27
27
OPTIONS
28
28
-------
29
- <file>...::
30
- Files to remove. Fileglobs (e.g. `*.c`) can be given to
31
- remove all matching files. If you want Git to expand
32
- file glob characters, you may need to shell-escape them.
33
- A leading directory name
34
- (e.g. `dir` to remove `dir/file1` and `dir/file2`) can be
35
- given to remove all files in the directory, and recursively
36
- all sub-directories,
37
- but this requires the `-r` option to be explicitly given.
29
+ <pathspec>...::
30
+ Files to remove. A leading directory name (e.g. `dir` to remove
31
+ `dir/file1` and `dir/file2`) can be given to remove all files in
32
+ the directory, and recursively all sub-directories, but this
33
+ requires the `-r` option to be explicitly given.
34
+ +
35
+ The command removes only the paths that are known to Git.
36
+ +
37
+ File globbing matches across directory boundaries. Thus, given two
38
+ directories `d` and `d2`, there is a difference between using
39
+ `git rm 'd*'` and `git rm 'd/*'`, as the former will also remove all
40
+ of directory `d2`.
41
+ +
42
+ For more details, see the 'pathspec' entry in linkgit:gitglossary[7].
38
43
39
44
-f::
40
45
--force::
@@ -69,19 +74,6 @@ OPTIONS
69
74
for each file removed. This option suppresses that output.
70
75
71
76
72
- DISCUSSION
73
- ----------
74
-
75
- The <file> list given to the command can be exact pathnames,
76
- file glob patterns, or leading directory names. The command
77
- removes only the paths that are known to Git. Giving the name of
78
- a file that you have not told Git about does not remove that file.
79
-
80
- File globbing matches across directory boundaries. Thus, given
81
- two directories `d` and `d2`, there is a difference between
82
- using `git rm 'd*'` and `git rm 'd/*'`, as the former will
83
- also remove all of directory `d2`.
84
-
85
77
REMOVING FILES THAT HAVE DISAPPEARED FROM THE FILESYSTEM
86
78
--------------------------------------------------------
87
79
There is no option for `git rm` to remove from the index only
0 commit comments