dromodel
dromodel

Reputation: 10193

Git unexpectedly ignoring files excluded in .gitignore

My .gitignore file contains the following lines:

make/
!make/*.mak

When I run "git add make/file.mak" I get the following error:

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

Why am I getting this error when I added make/file.mak to the exception list?

Upvotes: 1

Views: 225

Answers (1)

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 798456

Because make/ itself has not been overridden. Change the first line to /make/*.

Upvotes: 3

Related Questions