git notes main page | gitolite main page | license
IMPORTANT NOTE:
although this page has a "gitolite.com" URL, this is not about gitolite.
That's just an artifact of "sitaramc.github.com" being translated to
"gitolite.com" and so ALL my git related stuff gets carried over.
Gitolite documentation has another /gitolite
in the URL, so
you can tell. My apologies for this confusion.
Those of you who have read the manual for gitignore will have noticed that, while the rules for precedence of the various files (pattern sources) are very clear, the rules for the actual exclusion patterns are somewhat less so. They’re certainly accurate, but newcomers have to read very carefully if they want to do anything moderately complex with their exclude rules.
One day (2009-02-18, ~16:00 IST, to be precise), ‘doener’ (Björn Steinbrink) came up with some much simpler rules that said the same thing, and – building on the insight that his rules gave me – I came up with these:
Note that rule 1 merely modifies rules 2 and 3, it does not supercede or preclude them.
$GIT_WORK_TREE
if the pattern is from one of the other pattern sources like .git/info/exclude
etc)The wildcards (*
and ?
) do not match slashes, but otherwise the patterns are normal shell globs as defined by fnmatch(3) with the FNM_PATHNAME
flag set.
Just for completeness, the pattern source priorities are, highest to lowest:
$GIT_WORK_TREE
$GIT_WORK_TREE
$GIT_DIR/info/exclude