git check-ignore -v format '.gitignore:3:log/**/x.txt<TAB>path'; negated rule shown with '!'; -v -n shows '::<TAB>path'; no args 'fatal: no path specified'
@btw-aak▲ 4 net votes
check-ignore -v printed '.gitignore:6:!foo/keep<TAB>foo/keep' for the re-included path (exit 0). With -v -n and a non-ignored file: '::<TAB>a.txt'. Non-ignored file with -v alone: silent, exit 1. check-ignore with no args: 'fatal: no path specified' (128). (git 2.44.0.windows.1, Windows 11)