summaryrefslogtreecommitdiffstats
path: root/gitignore.html
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-12-17 15:54:21 -0800
committerJunio C Hamano <gitster@pobox.com>2013-12-17 15:54:21 -0800
commitcf77b0414a44eadfcd0c74dfcae739427b7d2cce (patch)
tree1519c182edb5f1d3603ae6d752dcb9106e36f117 /gitignore.html
parent4c8f2d99229331de853716af53a6a0901b4b0d68 (diff)
downloadgit-htmldocs-cf77b0414a44eadfcd0c74dfcae739427b7d2cce.tar.gz
Autogenerated HTML docs for v1.8.5.2-192-g7794
Diffstat (limited to 'gitignore.html')
-rw-r--r--gitignore.html20
1 files changed, 17 insertions, 3 deletions
diff --git a/gitignore.html b/gitignore.html
index 13ce60d60..99473b6ca 100644
--- a/gitignore.html
+++ b/gitignore.html
@@ -850,8 +850,10 @@ A line starting with # serves as a comment.
<p>
An optional prefix "<code>!</code>" which negates the pattern; any
matching file excluded by a previous pattern will become
- included again. If a negated pattern matches, this will
- override lower precedence patterns sources.
+ included again. It is not possible to re-include a file if a parent
+ directory of that file is excluded. Git doesn&#8217;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 ("<code>\</code>") in front of the first "<code>!</code>" for patterns
that begin with a literal "<code>!</code>", for example, "<code>\!important!.txt</code>".
</p>
@@ -979,6 +981,18 @@ use <em>git update-index &#45;&#45;assume-unchanged</em>.</p></div>
</div></div>
<div class="paragraph"><p>The second .gitignore prevents Git from ignoring
<code>arch/foo/kernel/vmlinux.lds.S</code>.</p></div>
+<div class="paragraph"><p>Example to exclude everything except a specific directory <code>foo/bar</code>
+(note the <code>/*</code> - without the slash, the wildcard would also exclude
+everything within <code>foo/bar</code>):</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><code> $ cat .gitignore
+ # exclude everything except directory foo/bar
+ /*
+ !/foo
+ /foo/*
+ !/foo/bar</code></pre>
+</div></div>
</div>
</div>
<div class="sect1">
@@ -1000,7 +1014,7 @@ use <em>git update-index &#45;&#45;assume-unchanged</em>.</p></div>
<div id="footnotes"><hr /></div>
<div id="footer">
<div id="footer-text">
-Last updated 2013-11-07 16:30:38 PST
+Last updated 2013-12-17 15:53:46 PST
</div>
</div>
</body>