Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
2020-07-14-ignore-files-in-gitignore-using-globbing-patterns.md

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).

video

contents

1. globbing patterns

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

  1. * for any char in a single segment (folder)
  2. ? for single char
  3. []for range
  4. ! for negation
  5. \ for escape
  6. / for directory
  7. # for comment
  8. ** for any char in multiple segment/folder

3. my scenario

  • in one particular example, I need to filter all docs that contain either -prod1 string or alert string
  • also nothing in /docs folder
_site
.sass-cache
.jekyll-cache
.jekyll-metadata
vendor
gemfile.lock
*-prod1*
*alert*
/docs

4. sources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment