21 February 2016

Git: Fix pathspec 'Iconr' did not match any file


When using a Mac on my git repositories I occasionally accidentally commit the Icon? files which results in the message:
fatal: pathspec 'Iconr' did not match any file

The answer to is update the index not only where the working tree has a file matching but also where the index already has an entry. The '-A' adds, modifies, and removes index entries to match the working tree. (http://git-scm.com/docs/git-add)
  1. Open the location in command line or Terminal if on Mac
  2. Enter the following commands to:
    git add . -A
    git commit -m "Updated the index"
    git push origin master

No comments:

Post a Comment