Ignore Files In Gitignore Using Globbing Patterns
abstract
The concern is documenting how to ignore files in a git project with a .gitignore
file using so called globbing pattens (aka standard wildcards).
1. globbing patterns
- glob(7): globbing pathnames — Linux man page
- glob is a pattern matching program since the earliest times of Unix (V6/1975?)
- globbing patters are known as standard wildcards
- not regex
Sixth Edition Unix, also called Version 6 Unix or just V6, was the first version of the Unix operating system to see wide release outside Bell Labs. It was released in May 1975 and, like its direct predecessor, targeted the DEC PDP-11 family of minicomputers. It was superseded by Version 7 Unix in 1978/1979, although V6 systems remained in regular operation until at least 1985.
— from Version 6 Unix — Wikipedia
- powershell has globbing patterns implemented as well without any addition; DOS has some differences (see the wikipedia page)
2. special characters
*
for any char?
for single char[]
for range!
for negation\
for escape/
for directory#
for comment
3. my scenario
- in one particular example, I need to filter all docs that contain either
-prod1
string oralert
string - also nothing in
/docs
folder
_site
.sass-cache
.jekyll-cache
.jekyll-metadata
vendor
gemfile.lock
*-prod1*
*alert*
/docs