I have some trouble with a git repository of mine and I cant find the error :(
Thing is, I had this repository already in use for a PHP project. everything was fine. The
I often have this problem if something has changed, added files to gitignore or something else. Maybe you have to rebuild the index.
Updated: added recursive and file param to git rm
In my case this worked:
remove cached files (only the paths are removed from the index, not the real files!!!)
git rm -r --cached .
add all files to the index
git add .
commit
git commit -m "hopefully fixed pathspec error"
UPDATE: If this won't work, try the following:
composer, composer.lock, vendor/
from your .gitignorecomposer, composer.lock, vendor/
outside your repo-A
to add that the files are deletedcomposer, composer.lock, vendor/
to your .gitignore and commitcomposer, composer.lock, vendor/
to your repoNow it should be gone from the repo and due to your .gitignore, never will be commited again. Hopefully the pathspec error is gone :)