Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
gitignore.txt: clarify recursive nature of excluded directories
author
Karsten Blees
<karsten.blees@gmail.com>
Thu, 7 Nov 2013 21:36:29 +0000
(22:36 +0100)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 9 Dec 2013 18:55:48 +0000
(10:55 -0800)
Additionally, precedence of negated patterns is exactly as outlined in
the DESCRIPTION section, we don't need to repeat this.
Signed-off-by: Karsten Blees <blees@dcon.de>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/gitignore.txt
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
8447dc8
)
diff --git
a/Documentation/gitignore.txt
b/Documentation/gitignore.txt
index f9719605123003c97bdf2999f912712536fa927a..205e80ef884a8c8852d7e83ca1ee660a5e1e8414 100644
(file)
--- a/
Documentation/gitignore.txt
+++ b/
Documentation/gitignore.txt
@@
-79,8
+79,10
@@
PATTERN FORMAT
- An optional prefix "`!`" which negates the pattern; any
matching file excluded by a previous pattern will become
- An optional prefix "`!`" 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'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`".
Put a backslash ("`\`") in front of the first "`!`" for patterns
that begin with a literal "`!`", for example, "`\!important!.txt`".
@@
-182,6
+184,19
@@
Another example:
The second .gitignore prevents Git from ignoring
`arch/foo/kernel/vmlinux.lds.S`.
The second .gitignore prevents Git from ignoring
`arch/foo/kernel/vmlinux.lds.S`.
+Example to exclude everything except a specific directory `foo/bar`
+(note the `/*` - without the slash, the wildcard would also exclude
+everything within `foo/bar`):
+
+--------------------------------------------------------------
+ $ cat .gitignore
+ # exclude everything except directory foo/bar
+ /*
+ !/foo
+ /foo/*
+ !/foo/bar
+--------------------------------------------------------------
+
SEE ALSO
--------
linkgit:git-rm[1],
SEE ALSO
--------
linkgit:git-rm[1],