# gitignore: negating path patterns

1 messages from 2008-05-21 to 2008-05-21. Participants: Michael J Gruber.
Thread: https://gitlist.dev/t/13598

## Michael J Gruber, 2008-05-21 14:40

Subject: gitignore: negating path patterns
Message-ID: <g11c8p$kgp$1@ger.gmane.org>
URL: https://gitlist.dev/e/g11c8p%24kgp%241%40ger.gmane.org

```
Hi there

It seems that negating path patterns in gitignore doesn't work, or I 
don't understand it (or both). With the attached script, git status 
(1.5.5.1) reports "dir/a" as new and "dir/b" as untracked. I would 
rather expect it to report "dir/c" as untracked also.

It seems that "!b" matches to include "dir/b" (reverting the exclusion 
"*" as expected), whereas "!dir/" does not match to include "dir/c".

What's going on here?

Michael

P.S.: "*" in dir/.gitignore would do what I want, but I want all 
patterns in one place.

```
