Sometimes you want to know what your ignore rules are hiding. Maybe a folder has grown huge, or a file you expected in the commit isn’t showing up. git status can show both lists at once.
git status --ignored -s
Ignored files get their own marker, !!, next to the familiar ones:
M src/app.js
?? notes.txt
!! build/
!! debug.log
An ignored folder shows up as one line, which keeps it readable. Without -s, the long format gets an extra section called Ignored files at the bottom.
This answers questions like “why isn’t my file in the commit?”. If it’s in the !! list, an ignore rule is hiding it, and git check-ignore -v tells you which rule. It’s also a quick way to find out what git clean -X would remove.
On a project with node_modules or a big cache folder, the list can be long and a bit slow because git has to walk those folders. I’d use it to look, not in a prompt or script that runs all the time. And it only reflects your current rules: a file that’s tracked is never listed as ignored, even if a pattern matches it.
Further reading: git-status documentation