Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to check if a file is git ignored [duplicate]

Tags:

git

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?

like image 336
Parag Avatar asked Oct 12 '17 16:10

Parag


1 Answers

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
like image 133
wl2776 Avatar answered Sep 19 '22 16:09

wl2776