In brief
git check-ignore -v identifies the exclusion rule matching a path. It helps explain why an expected file does not appear as untracked.
Useful to know
git check-ignore -v identifies the exclusion rule matching a path. It helps explain why an expected file does not appear as untracked. [1]
Ignore rules do not normally stop tracking a file already recorded. Establish its state first. Avoid adding increasingly broad exclusions before knowing whether the problem concerns a pattern, scope or existing tracking.
Sources
For further detail and to check the information: