git check-ignore

The command that tells you whether a path is ignored and, with -v, which file, line and pattern ignored it.

In more detail

When a file mysteriously does not show up in git status, git check-ignore -v path answers the question instead of you reading every ignore file. It prints nothing for a path no rule matches.

Example

git check-ignore -v build/out.o

Related terms

Taught in

References