16

I have two css files. One is GIT ignored and other is not.

I want to confirm which one is ignored and which one is not.

I can use following command to check if files are ignored.

git status --ignored

How to check for a specific file?

Parag
  • 183
  • 2
  • 7

1 Answers1

22

git check-ignore <filename>

From https://git-scm.com/docs/git-check-ignore

git-check-ignore - Debug gitignore / exclude files

-v shows specific line and file that make git to ignore the file.

$ git check-ignore -v build
C:/Users/username/gitignore:23:**/build*       build
wl2776
  • 4,099
  • 4
  • 35
  • 77