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

前端 未结 4 1510
暖寄归人
暖寄归人 2021-02-02 13:15

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:

相关标签:
4条回答
  • 2021-02-02 13:36

    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
    
    0 讨论(0)
  • 2021-02-02 13:40

    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"
    
    0 讨论(0)
  • 2021-02-02 13:45

    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.
    0 讨论(0)
  • 2021-02-02 13:55

    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"
    
    0 讨论(0)
提交回复
热议问题