summaryrefslogtreecommitdiff
path: root/Documentation/gitignore.txt
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2012-10-07 03:13:54 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-10-07 23:15:19 (GMT)
commit866f5f82b9fdedb0304708f9b78db1409fecd046 (patch)
treee9399a4df8703bd4b4a24e8edc08a16295c239fa /Documentation/gitignore.txt
parent889d35899ba64640e47798681ecb34a4be043bad (diff)
downloadgit-866f5f82b9fdedb0304708f9b78db1409fecd046.zip
git-866f5f82b9fdedb0304708f9b78db1409fecd046.tar.gz
git-866f5f82b9fdedb0304708f9b78db1409fecd046.tar.bz2
gitignore.txt: suggestions how to get literal # or ! at the beginning
We support backslash escape, but we hide the details behind the phrase "a shell glob suitable for consumption by fnmatch(3)". So it may not be obvious how one can get literal # or ! at the beginning of pattern. Add a few lines on how to work around the magic characters. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/gitignore.txt')
-rw-r--r--Documentation/gitignore.txt6
1 files changed, 5 insertions, 1 deletions
diff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt
index c1f692a..14ade3e 100644
--- a/Documentation/gitignore.txt
+++ b/Documentation/gitignore.txt
@@ -68,11 +68,15 @@ PATTERN FORMAT
for readability.
- A line starting with # serves as a comment.
+ Put a backslash ("`\`") in front of the first hash for patterns
+ that begin with a hash.
- - An optional prefix '!' which negates the pattern; any
+ - 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.
+ Put a backslash ("`\`") in front of the first "`!`" for patterns
+ that begin with a literal "`!`", for example, "`\!important!.txt`".
- If the pattern ends with a slash, it is removed for the
purpose of the following description, but it would only find