juanpastas juanpastas - 1 year ago 139
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.

Answer Source

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)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download