referring the online docs:
if pattern not contain slash /, git treats shell glob pattern , checks match against pathname relative location of .gitignore file (relative toplevel of work tree if not .gitignore file).
to me, documentation says given pattern 'foo', file or directory named 'foo' ignored relative .gitignore file. don't read explaining recursive behavior. shell globs (from what read , experience) not recursive.
now further below explains double asterisk:
a leading "**" followed slash means match in directories. example, "**/foo" matches file or directory "foo" anywhere, same pattern "foo"
so yes there example in docs explaining **/foo equal foo, recursive behavior remains implicit.
the recursive nature of rule "foo" derived way rules fetched , applied:
patterns read
.gitignorefile in same directory path, or in parent directory, patterns in higher level files (up toplevel of work tree) being overridden in lower level files down directory containing file.
so multiple sub-directories below .gitignore, rule "foo" still apply "foo" file found in said sub-folder.
Comments
Post a Comment