git problem : fatal: Unable to write new index file

后端 未结 14 612
抹茶落季
抹茶落季 2020-12-29 02:52

I have an existing project that has been managed under git. I recently had to do a ground-up rebuild of the computer (OS X Snow Leopard), and returning to the project, git c

相关标签:
14条回答
  • 2020-12-29 03:17

    If you are using sshfs, add the option -o workaround=rename, as described here: http://alan.lamielle.net/2009/07/08/git-over-sshfs

    0 讨论(0)
  • 2020-12-29 03:19

    Do you have write access to .git (=can you create new files there and edit existing ones)? If not then adjust the file permissions.

    If you have write permissions it seems you found a bug. You can try to recover by

    1. create a clone from your current working copy
    2. remove all files from the working copy of the clone
    3. copy all wc files from your current working copy to the clone (and don't copy .git)
    4. try to commit something in the clone.

    When the last step works you need setup the remote branches from your current repo to the clone, and then you can use the cloned repo as your new working copy.

    0 讨论(0)
  • 2020-12-29 03:21

    I had the same problem. "fatal: Unable to write new index file"

    I found out that the reason was that my disk was full. I removed something else from it and then my git repo recovered and all worked again.

    0 讨论(0)
  • 2020-12-29 03:24

    I had a similar problem. "git reset --hard" worked for me.

    0 讨论(0)
  • 2020-12-29 03:24

    I had used this problem when using git on visual studio, and my solution was to run visual studio as an administrator

    0 讨论(0)
  • 2020-12-29 03:26

    I'd like to point out one more cause of this error

    If you are cloning a git repository that contains another git repository in it (not submodule), you will get this behaviour.

    Hope it'll help somebody.

    0 讨论(0)
提交回复
热议问题