18

I am using Twitter's Fabric on my iOS app.

Crashlytics in Fabric just updated itself and now I cannot commit my project to git. I get the error:

git error: unable to index file Crashlytics.framework/Headers

fatal: updating files failed

enter image description here

Any idea what is going wrong or how to fix it?

Running git status reveals:

Untracked files:
(use "git add <file>..." to include in what will be committed)

Crashlytics.framework/Info.plist
Fabric.framework/Info.plist
profile.xcodeproj/project.xcworkspace/xcuserdata/
profile.xcodeproj/xcuserdata/
7
  • Could you go to the directory and do git status and then a git remote -v and put the output here? Commented Jun 1, 2015 at 18:48
  • @gran_profaci I added some pertinent git status output. as for git remote -v it just showed my github repository for both push and fetch Commented Jun 1, 2015 at 18:53
  • Did you try re-adding your repo in Xcode Preferences > Source Control? Commented Jun 1, 2015 at 19:07
  • @gran_profaci no. I need to re add it? Commented Jun 1, 2015 at 19:30
  • You could always ensure it's working fine. You could also try cleaning your workspace by a clean build and also a git clean -f -d Commented Jun 1, 2015 at 20:20

4 Answers 4

27

Going into terminal and manually committing to git solved the issue. All my further commits in xcode have worked since.

git add .
git commit -m "message"
Sign up to request clarification or add additional context in comments.

Comments

11

I think this relates to the git submodule since I had similar issue. However adding or removing it didn't help. What worked was reseting it into HEAD version, e.g.

git reset HEAD problematic_file_or_dir

Comments

2

The same issue happen to me with the Bolts.framework and Parse.framework. Both were added in the git repo already, so adding them back did not fixed the issue. I had to remove first:

cd MyApp/SDK/
git rm -r Parse.framework/
git rm -r Bolts.framework/

The I had to copy them again in the SDK/ folder and adding to git

 cd MyApp/SDK/
 git add .
 git commit * -m "Maintenance: Fixed git error unable to index file"

1 Comment

I managed to make it work by doing "git add" for the files under Bolts.framework and followed by "git commit" command line. Strange that I cannot do this under the Xcode UI.
1

This happened to me with IntelliJ IDEA. An error popup appeared when I tried to commit with the IDE git plugin. Probably this is related to the fact that I had staged a path that was previously a file but now is a directory, and have that previous file moved to the new directory.

Suppose that path is bin/yii. What I did was:

  • Rename the directory to something different, e.g. bin/yii-temp
  • Commit the directory and its contents
  • Rename the directory back to bin/yii
  • Commit with --amend what I had just committed.

3 Comments

Thanks, worked for me! :-) Was exactly the case: I had deleted my gulpfile.js and created a folder with the same name (see gulpjs.com/docs/en/getting-started/javascript-and-gulpfiles).
Although amend didn't work for me. I just commited one more time.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.