Skip to content

Commit 530d710

Browse files
committed
Merge branch 'nd/doc-ignore' into maint
* nd/doc-ignore: gitignore.txt: suggestions how to get literal # or ! at the beginning
2 parents 352611f + 866f5f8 commit 530d710

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Documentation/gitignore.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,15 @@ PATTERN FORMAT
7474
for readability.
7575

7676
- A line starting with # serves as a comment.
77+
Put a backslash ("`\`") in front of the first hash for patterns
78+
that begin with a hash.
7779

78-
- An optional prefix '!' which negates the pattern; any
80+
- An optional prefix "`!`" which negates the pattern; any
7981
matching file excluded by a previous pattern will become
8082
included again. If a negated pattern matches, this will
8183
override lower precedence patterns sources.
84+
Put a backslash ("`\`") in front of the first "`!`" for patterns
85+
that begin with a literal "`!`", for example, "`\!important!.txt`".
8286

8387
- If the pattern ends with a slash, it is removed for the
8488
purpose of the following description, but it would only find

0 commit comments

Comments
 (0)