Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2010-03-05 18:56:39 +0300
committerJunio C Hamano <gitster@pobox.com>2010-06-01 05:11:10 +0400
commit81c13fde379c46cad6b6e4a03ed7ee4f686c030f (patch)
tree00992dda861c7109c4f1129d6481d77e66bc47ab /Documentation/gitignore.txt
parent371276bf29314af04b804cfd877abcac62674a58 (diff)
gitignore.5: Clarify matching rules
Patterns containing a / are implicitly anchored to the directory containing the relevant .gitignore file. Patterns not containing a / are textual matches against the path name relative to the directory containing .gitignore. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/gitignore.txt')
-rw-r--r--Documentation/gitignore.txt14
1 files changed, 9 insertions, 5 deletions
diff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt
index 98c459dc82..e10fa88b8c 100644
--- a/Documentation/gitignore.txt
+++ b/Documentation/gitignore.txt
@@ -83,16 +83,20 @@ Patterns have the following format:
- If the pattern does not contain a slash '/', git treats it as
a shell glob pattern and checks for a match against the
- pathname without leading directories.
+ pathname relative to the location of the `.gitignore` file
+ (relative to the toplevel of the work tree if not from a
+ `.gitignore` file).
- Otherwise, git treats the pattern as a shell glob suitable
for consumption by fnmatch(3) with the FNM_PATHNAME flag:
wildcards in the pattern will not match a / in the pathname.
For example, "Documentation/\*.html" matches
- "Documentation/git.html" but not
- "Documentation/ppc/ppc.html". A leading slash matches the
- beginning of the pathname; for example, "/*.c" matches
- "cat-file.c" but not "mozilla-sha1/sha1.c".
+ "Documentation/git.html" but not "Documentation/ppc/ppc.html"
+ or "tools/perf/Documentation/perf.html".
+
+ - A leading slash matches the beginning of the pathname.
+ For example, "/*.c" matches "cat-file.c" but not
+ "mozilla-sha1/sha1.c".
An example: