I know that there are a lot of questions about how to ignore directories, and until now I have usually had no problems, but now I'm stuck with something I don’t understand.
Here is my directory structure:
/src /war com.example.MyProject/ WEB-INF/ classes/ deploy/ lib/
I want to ignore the contents of the classes/
, deploy/
and com.example.MyProject/
, and here is my .gitignore file:
*.log war/WEB-INF/classes/ war/WEB-INF/deploy/ com.example.MyProject/
Files under com.example.MyProject/
automatically generated, and git ignores all of them, except for a file named com.example.MyProject.nocache.js
. In fact, when I do git status
, I get:
# On branch myBranch
Why does git refuse to ignore this single file in this directory? What am I doing wrong?
source share