That git check-ignore --verbose "$@" will tell you which gitignore rules applied to a given set of paths
git check-ignore --verbose "$@"