$ git --version
git version 2.6.4
I realize this is a duplicate but the other question's answers have not helped.
Folder structure
/
-- dist/
---- samples/
---- README.md
---- foo/
---- bar/
---- baz.js
I want to ignore everything in dist except samples and README.md. My first few tries at it didn't work, so I settled on just unignoring the README:
dist
!dist/samples/README.md
README is a brand new file. The dist folder is not in source control at all. But when I check ignore, it's still being ignored:
$ git check-ignore dist/samples/README.md
dist/samples/README.md
$ git check-ignore src
# empty line
I've tried:
- changing the order of the ignores
- removing the slash from the beginning of the line
- adding a ** in the middle:
dist/**/README.md
- adding a
/*
to the end ofdist
on the first line
The only other things being ignored are *.js, *.js.map, temp and node_modules. The funny thing is that Webstorm thinks that the file is not being ignored (it changes color) but the command line tool does think it is being ignored.
I don't see what I'm doing wrong. The pattern seems very simple:
- ignore all the things in this directory
- don't ignore this one thing here
But it's clearly not working.