From: Junio C Hamano Date: Wed, 17 Oct 2012 17:28:42 +0000 (-0700) Subject: Merge branch 'nd/doc-ignore' into maint X-Git-Tag: v1.7.12.4~4 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/530d71011e358a43e8f8489e320081f49fe96c4f?ds=inline;hp=-c Merge branch 'nd/doc-ignore' into maint * nd/doc-ignore: gitignore.txt: suggestions how to get literal # or ! at the beginning --- 530d71011e358a43e8f8489e320081f49fe96c4f diff --combined Documentation/gitignore.txt index 96639e02bd,14ade3e6a5..1b82fe1969 --- a/Documentation/gitignore.txt +++ b/Documentation/gitignore.txt @@@ -41,24 -41,18 +41,24 @@@ precedence, the last matching pattern d variable 'core.excludesfile'. Which file to place a pattern in depends on how the pattern is meant to -be used. Patterns which should be version-controlled and distributed to -other repositories via clone (i.e., files that all developers will want -to ignore) should go into a `.gitignore` file. Patterns which are -specific to a particular repository but which do not need to be shared -with other related repositories (e.g., auxiliary files that live inside -the repository but are specific to one user's workflow) should go into -the `$GIT_DIR/info/exclude` file. Patterns which a user wants git to -ignore in all situations (e.g., backup or temporary files generated by -the user's editor of choice) generally go into a file specified by -`core.excludesfile` in the user's `~/.gitconfig`. Its default value is -$XDG_CONFIG_HOME/git/ignore. If $XDG_CONFIG_HOME is either not set or empty, -$HOME/.config/git/ignore is used instead. +be used. + + * Patterns which should be version-controlled and distributed to + other repositories via clone (i.e., files that all developers will want + to ignore) should go into a `.gitignore` file. + + * Patterns which are + specific to a particular repository but which do not need to be shared + with other related repositories (e.g., auxiliary files that live inside + the repository but are specific to one user's workflow) should go into + the `$GIT_DIR/info/exclude` file. + + * Patterns which a user wants git to + ignore in all situations (e.g., backup or temporary files generated by + the user's editor of choice) generally go into a file specified by + `core.excludesfile` in the user's `~/.gitconfig`. Its default value is + $XDG_CONFIG_HOME/git/ignore. If $XDG_CONFIG_HOME is either not set or + empty, $HOME/.config/git/ignore is used instead. The underlying git plumbing tools, such as 'git ls-files' and 'git read-tree', read @@@ -74,11 -68,15 +74,15 @@@ PATTERN FORMA 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