I noticed in my team's .gitignore file the following lines, and I'm not sure what they mean:
...
syntax: regexp
...
syntax: glob
...
I've tried searching online, and while I've found lots of information about glob syntax and regexp syntax, I've found nothing that explains what actually putting the line syntax: glob
, etc. in the .gitignore file means. Even the gitignore documentation doesn't make any mention of it.
Each of those lines is followed by several lines containing filenames, directories, etc. Are these lines telling git what syntax the following lines use when pattern matching?
This means nothing at all in a .gitignore
: Git tries to treat those as naming the files named syntax: regexp
and syntax: glob
.
These strings have a very specific meaning in .hgignore
, in Mercurial. Here they tell Mercurial that subsequent strings are either regular expressions, or glob patterns.
All Git entries are always essentially glob patterns. The "essentially" here covers for comments and !
lines.