Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find gitignore file and line causing a file to be ignored by git [duplicate]

Tags:

git

How can I find the gitignore file and line that is causing a file to be ignored by git?

like image 902
idbrii Avatar asked Aug 01 '12 17:08

idbrii


1 Answers

From the repo root, try this:

find . ~/.gitignore .git/info/exclude -name '*gitignore' -exec cat {} + | less

Also check that you're not using a different excludes file:

git config -l | grep exclude
core.excludesfile=~/.gitignore

You can also get that error when you have submodules in a subfolder instead at the git project's root.

Thanks to Jon Lin and Christopher for helping me figure this out on the original question.

like image 155
idbrii Avatar answered Oct 12 '22 06:10

idbrii