juanpastas juanpastas - 2 months ago 4x
Git Question

Where file is ignored by .gitignore

I am doing

git add db/schema.rb
The following paths are ignored by one of your .gitignore files:
Use -f if you really want to add them.
fatal: no files added

Where can I find this file is being ignored, see:

cat .gitignore
cat ~/.gitignore

is for global ignores.


You can easily check what .gitignore rule is currently making your file ignored in your git repo with git check-ignore (you must have git

cd /path/to/your/repo
git check-ignore -v -- path/to/your/file

(The -v -- verbose -- option is important to see the rule)