Reputation: 743
I have a two directories named "static" in my project. One with the path "static/" and the other with a path "core/static/". I want to gitignore the first static directory, but I want the "core/static" directory to be tracked.
My current .gitignore file contains:
static
!core/static
Upvotes: 2
Views: 34
Reputation: 20809
change static
to /static
.
The leading / makes git use an absolute path, this will only ignore the directory specified at that specific absolute location.
Upvotes: 3