7

Is there any way to do a case insensitive .gitignore using a regex for example? For example, inbox, Inbox, inBox, should all be ignored with a one liner in .gitignore. ? I am writing a script to generate a .gitignore file and hence do not know what kind of pattern would be available at the client side.

infoclogged
  • 3,641
  • 5
  • 32
  • 53
  • 1
    Just a note: gitignore is case-sensitive. But on macOS, having the line `.DS_STORE` in gitignore ignores the file `.DS_Store` as well for me, i.e. is case-insensitive. However, that is likely because of the default macOS filesystem's (lack of) case-sensitivity support. – nishanthshanmugham Jul 08 '21 at 12:30

1 Answers1

11

Based on this answer, gitignore file accepts glob patterns.

Following your example, you could do

[Ii]n[bB]ox
nishanthshanmugham
  • 2,967
  • 1
  • 25
  • 29
Flows
  • 3,675
  • 3
  • 28
  • 52