3

I recently tried adding the OpenEars framework to my xcode project, and when I tried to commit my project to the repository I get the following error:

error: pathspec '"Framework/Icon\r"' did not match any file(s) known to git.

I have tried to find this file using the navigation tree within xcode but it doesn't exist. There is a physical file on the disk which was 0 bytes (this is most likely the problem), and I tried removing this with no affect.

I tried to navigate to the file using terminal and use git rm Icon\r but due to the \ in the name it cannot find the file:

$ git rm Icon\\r
fatal: pathspec 'Framework/OpenEars.framework/Icon\r' did not match any files

Has anyone had a similar issue or know how I can remove this file as it is stopping me from pushing any changes.

kenorb
  • 155,785
  • 88
  • 678
  • 743
Elliott D'Alvarez
  • 1,217
  • 16
  • 30
  • Possible duplicate of [Remove weird 'Iconr' file from the repository](http://stackoverflow.com/questions/22589978/remove-weird-iconr-file-from-the-repository) – kenorb Aug 17 '16 at 13:06

2 Answers2

6

Try cding into the directory, then start typing the following until you get to the I in Icon\r. Then press the Tab key to have the Terminal automatically complete the rest of the path. It will look like this:

git rm Framework/OpenEars.framework/Icon^M

NB: There is a space after the M. Entering in this full path does not seem to work: only allowing the Terminal to autocomplete the path for you will.

I got:

MacPro:OpenEarsDistribution mdouma46$ git rm Framework/OpenEars.framework/Icon^M 
'm 'Framework/OpenEars.framework/Icon
MacPro:OpenEarsDistribution mdouma46$ git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#   deleted:    "Framework/OpenEars.framework/Icon\r"
#
NSGod
  • 22,699
  • 3
  • 58
  • 66
  • Hmm, must have to do with the git export flattening the framework's icon. I'll look into it for the next version. – Halle Oct 08 '12 at 21:51
  • Thanks for the help, this worked for me after some alterations. I forgot the space the first time and this entered in to a second console thing which seemed to remove the reference but didn't register the removal on xcode. So I had to delete the whole framework and re-add it, this created a fresh file for me to remove properly. Thanks once again! – Elliott D'Alvarez Oct 09 '12 at 10:33
  • I'd advise users to make a copy of the problematic file before removal. – Tommie C. Mar 28 '14 at 21:35
0

I've just had the same issue, and found that after removing the file from the local filesystem, the following worked for me:

cd Your/Project/Directory
git add -u Path/To/Offending/File/Icon$'r'

This then allowed me to commit and remove the files from the git repository.

Dave Barker
  • 155
  • 1
  • 7