git problem : fatal: Unable to write new index file

后端 未结 14 611
抹茶落季
抹茶落季 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: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.

提交回复
热议问题