Is there a way to ignore all files of a type in a directory?
** is apparently meaningless to git, so this doesn't work:
**
/public/static/**/*.js
The idea is to match arbitrary nested folders.
It would appear that the ** syntax is supported by git as of version 1.8.2.1 according to the documentation.
git
1.8.2.1
Two consecutive asterisks ("**") in patterns matched against full pathname may have special meaning: A leading "**" followed by a slash means match in all directories. For example, "**/foo" matches file or directory "foo" anywhere, the same as pattern "foo". "**/foo/bar" matches file or directory "bar" anywhere that is directly under directory "foo". A trailing "/**" matches everything inside. For example, "abc/**" matches all files inside directory "abc", relative to the location of the .gitignore file, with infinite depth. A slash followed by two consecutive asterisks then a slash matches zero or more directories. For example, "a/**/b" matches "a/b", "a/x/b", "a/x/y/b" and so on. Other consecutive asterisks are considered invalid.
Two consecutive asterisks ("**") in patterns matched against full pathname may have special meaning:
A leading "**" followed by a slash means match in all directories. For example, "**/foo" matches file or directory "foo" anywhere, the same as pattern "foo". "**/foo/bar" matches file or directory "bar" anywhere that is directly under directory "foo".
**/foo
foo
**/foo/bar
bar
A trailing "/**" matches everything inside. For example, "abc/**" matches all files inside directory "abc", relative to the location of the .gitignore file, with infinite depth.
/**
abc/**
abc
.gitignore
A slash followed by two consecutive asterisks then a slash matches zero or more directories. For example, "a/**/b" matches "a/b", "a/x/b", "a/x/y/b" and so on.
a/**/b
a/b
a/x/b
a/x/y/b
Other consecutive asterisks are considered invalid.
1.4m articles
1.4m replys
5 comments
57.0k users