summaryrefslogtreecommitdiffstats
path: root/gitignore.txt
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-03-18 15:52:54 -0700
committerJunio C Hamano <gitster@pobox.com>2016-03-18 15:52:54 -0700
commit7abb87561492b87dd982ea57cb58faa684cabfac (patch)
tree113f420ab1a5597e7c510585fe8606b17359fa82 /gitignore.txt
parent52fef74e2ce646376acaa23b66676036d8b55198 (diff)
downloadgit-htmldocs-7abb87561492b87dd982ea57cb58faa684cabfac.tar.gz
Autogenerated HTML docs for v2.8.0-rc3-12-g04705
Diffstat (limited to 'gitignore.txt')
-rw-r--r--gitignore.txt53
1 files changed, 4 insertions, 49 deletions
diff --git a/gitignore.txt b/gitignore.txt
index 91d1ce2a8..473623d63 100644
--- a/gitignore.txt
+++ b/gitignore.txt
@@ -82,12 +82,12 @@ PATTERN FORMAT
- An optional prefix "`!`" which negates the pattern; any
matching file excluded by a previous pattern will become
- included again.
+ included again. It is not possible to re-include a file if a parent
+ directory of that file is excluded. Git doesn't list excluded
+ directories for performance reasons, so any patterns on contained
+ files have no effect, no matter where they are defined.
Put a backslash ("`\`") in front of the first "`!`" for patterns
that begin with a literal "`!`", for example, "`\!important!.txt`".
- It is possible to re-include a file if a parent directory of that
- file is excluded if certain conditions are met. See section NOTES
- for detail.
- If the pattern ends with a slash, it is removed for the
purpose of the following description, but it would only find
@@ -141,51 +141,6 @@ not tracked by Git remain untracked.
To stop tracking a file that is currently tracked, use
'git rm --cached'.
-To re-include files or directories when their parent directory is
-excluded, the following conditions must be met:
-
- - The rules to exclude a directory and re-include a subset back must
- be in the same .gitignore file.
-
- - The directory part in the re-include rules must be literal (i.e. no
- wildcards and has to start with a `/`).
-
-A re-inclusion of a directory makes all files in the directory
-unignored. For example, suppose you have files `.gitignore`,
-`dir/file1`, `dir/file2`, and `dir/file3`, and have the following in
-your `.gitignore`:
-
-----------------
-# .gitignore is not mentioned in .gitignore
-*
-!/dir
-# dir/file1 is not mentioned in .gitignore
-dir/file2
-!dir/file3
-----------------
-
-Then:
-
- - `.gitignore` gets ignored, because it matches the `*` at the top
- level;
-
- - `dir/file1` does not get ignored, because `/dir` marks everything
- underneath `dir/` directory to be 're-included' unless otherwise
- specified;
-
- - `dir/file2` gets ignored, because `dir/file2` matches it.
-
- - `dir/file3` does not get ignored, because `!dir/file3` matches it.
- Note that the entry `!dir/file3` is redundant because everything
- underneath `dir/` is marked to be 're-included' already.
-
-Some earlier versions of Git treated `!/dir` above differently in
-that it did not cause the paths under it unignored (but merely told
-Git that patterns that begin with dir/ should not be ignored), but
-this has been corrected to be consistent with `/dir` that says "the
-directory `dir/` and everything below are ignored."
-
-
EXAMPLES
--------