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
If you are using sshfs
, add the option -o workaround=rename
, as described here: http://alan.lamielle.net/2009/07/08/git-over-sshfs
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
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.
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.
I had a similar problem. "git reset --hard" worked for me.
I had used this problem when using git on visual studio, and my solution was to run visual studio as an administrator
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.