Documentation/gitignore.txt: Fix the seriously misleading priority explanation
Signed-off-by: David Kastrup <dak@gnu.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
David Kastrup committed
Jul 22, 2007 at 01:53 UTC
98ec4ad7f908a6df8c2d4eedf309c06fe840c5c3
1 file changed
+14
-8
Documentation/gitignore.txt
+14
-8
@@ -18,21 +18,26 @@ pattern.
18
19
When deciding whether to ignore a path, git normally checks
20
`gitignore` patterns from multiple sources, with the following
21
-order of precedence:
21
+order of precedence, from highest to lowest (within one level of
22
+precedence, the last matching pattern decides the outcome):
23
23
- * Patterns read from the file specified by the configuration
24
- variable 'core.excludesfile'.
25
-
26
- * Patterns read from `$GIT_DIR/info/exclude`.
24
+ * Patterns read from the command line for those commands that support
25
+ them.
26
27
* Patterns read from a `.gitignore` file in the same directory
29
- as the path, or in any parent directory, ordered from the
30
- deepest such file to a file in the root of the repository.
28
+ as the path, or in any parent directory, with patterns in the
29
+ higher level files (up to the root) being overriden by those in
30
+ lower level files down to the directory containing the file.
31
These patterns match relative to the location of the
32
`.gitignore` file. A project normally includes such
33
`.gitignore` files in its repository, containing patterns for
34
files generated as part of the project build.
35
36
+ * Patterns read from `$GIT_DIR/info/exclude`.
37
+
38
+ * Patterns read from the file specified by the configuration
39
+ variable 'core.excludesfile'.
40
+
41
The underlying git plumbing tools, such as
42
gitlink:git-ls-files[1] and gitlink:git-read-tree[1], read
43
`gitignore` patterns specified by command-line options, or from
@@ -49,7 +54,8 @@ Patterns have the following format:
54
55
- An optional prefix '!' which negates the pattern; any
56
matching file excluded by a previous pattern will become
52
- included again.
57
+ included again. If a negated pattern matches, this will
58
+ override lower precedence patterns sources.
59
60
- If the pattern does not contain a slash '/', git treats it as
61
a shell glob pattern and checks for a match against the