4

I have a global .gitignore file at my home directory. For a certain repository, I want one ignore pattern specified in my global .gitignore to be ignored because files with that pattern are necessary to be tracked in this repository. Is this possible?

Lahiru Chandima
  • 22,324
  • 22
  • 103
  • 179

1 Answers1

8

In your local repository add a .gitignore file that negates the rule from your global .gitignore.

For example:

global .gitignore

*.foo

repos .gitignore

!*.foo

You are basically doing the same thing as this question. Just in two different files.

Community
  • 1
  • 1
Schleis
  • 41,516
  • 7
  • 68
  • 87