How do you git show untracked files that do not exist in .gitignore

I'm using git status -u to show untracked files. And on the terminal, I see plenty untracked files that I need to be untracked such as unit tests, personal documentation, etc. I have put them in .gitignore, but it seems that git status still shows them.

How do you show only untracked files that don't exist in .gitignore.


You can explicitly list what is being tracked and untracked as follows to see if Git is seeing and honoring your .gitignore. If you post your .gitignore contents, git status output, and dir or ls we can better assist you.

List ignored files

$ git ls-files . --ignored --exclude-standard --others

List untracked files

$ git ls-files . --exclude-standard --others