frnhr
frnhr

Reputation: 12903

Ignore partial filename only if in specific directory

I wish to ignore:

settings/local_*.py
apps/settings/local_*.py
path_to/settings/local_*.py

But I don't wish to ignore:

local_*.py
something/else/local_*.py

And also I don't wish to ignore:

settings/non_local_*.py
...

Is this beyond gitignore?

Of course, I'm looking for a generic solution that will work no matter where the settings directory is located (within the repo).

Upvotes: 1

Views: 3380

Answers (1)

frnhr
frnhr

Reputation: 12903

Ah, I stabbed at the solution!

settings/local_*.py won't work.

But this will: **/settings/local_*.py!

Upvotes: 8

Related Questions