summaryrefslogtreecommitdiffstats
path: root/gitignore.html
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-03-10 14:58:00 -0800
committerJunio C Hamano <gitster@pobox.com>2016-03-10 14:58:00 -0800
commitdf97ffc354c223ba742bae4842b51593d5b9a722 (patch)
tree0360ede60879edcb2979fd315028712f47a11770 /gitignore.html
parent03a41f3855750dd7f9c9586b766f8f499df8ff92 (diff)
downloadgit-htmldocs-df97ffc354c223ba742bae4842b51593d5b9a722.tar.gz
Autogenerated HTML docs for v2.8.0-rc2
Diffstat (limited to 'gitignore.html')
-rw-r--r--gitignore.html50
1 files changed, 48 insertions, 2 deletions
diff --git a/gitignore.html b/gitignore.html
index 80a1b5975..dee4de81f 100644
--- a/gitignore.html
+++ b/gitignore.html
@@ -956,10 +956,56 @@ The rules to exclude a directory and re-include a subset back must
<li>
<p>
The directory part in the re-include rules must be literal (i.e. no
- wildcards)
+ wildcards and has to start with a <code>/</code>).
</p>
</li>
</ul></div>
+<div class="paragraph"><p>A re-inclusion of a directory makes all files in the directory
+unignored. For example, suppose you have files <code>.gitignore</code>,
+<code>dir/file1</code>, <code>dir/file2</code>, and <code>dir/file3</code>, and have the following in
+your <code>.gitignore</code>:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><code># .gitignore is not mentioned in .gitignore
+*
+!/dir
+# dir/file1 is not mentioned in .gitignore
+dir/file2
+!dir/file3</code></pre>
+</div></div>
+<div class="paragraph"><p>Then:</p></div>
+<div class="ulist"><ul>
+<li>
+<p>
+<code>.gitignore</code> gets ignored, because it matches the <code>*</code> at the top
+ level;
+</p>
+</li>
+<li>
+<p>
+<code>dir/file1</code> does not get ignored, because <code>/dir</code> marks everything
+ underneath <code>dir/</code> directory to be <em>re-included</em> unless otherwise
+ specified;
+</p>
+</li>
+<li>
+<p>
+<code>dir/file2</code> gets ignored, because <code>dir/file2</code> matches it.
+</p>
+</li>
+<li>
+<p>
+<code>dir/file3</code> does not get ignored, because <code>!dir/file3</code> matches it.
+ Note that the entry <code>!dir/file3</code> is redundant because everything
+ underneath <code>dir/</code> is marked to be <em>re-included</em> already.
+</p>
+</li>
+</ul></div>
+<div class="paragraph"><p>Some earlier versions of Git treated <code>!/dir</code> 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 <code>/dir</code> that says "the
+directory <code>dir/</code> and everything below are ignored."</p></div>
</div>
</div>
<div class="sect1">
@@ -1035,7 +1081,7 @@ everything within <code>foo/bar</code>):</p></div>
<div id="footnotes"><hr /></div>
<div id="footer">
<div id="footer-text">
-Last updated 2016-02-24 15:40:39 PST
+Last updated 2016-03-10 14:54:48 PST
</div>
</div>
</body>