Check whether a file or directory is ignored

git check-ignore

  • Analyze and debug Git ignore / exclude (".gitignore") files.
    More information: <https://git-scm.com/docs/git-check-ignore>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

git check-ignore {{path/to/file_or_directory}}

click the source code to copy install git check-ignore on any operating system with command-not-found.com