git error: unable to create temporary sha1 filename .git/objects/de: File exists

git is a great versioning system. The best I’ve worked with to be honest compared to SVN (which is the only other one I’ve worked with lol!) I haven’t looked at Mercurial yet. Either way, it can be annoying at times due to some ambigous error messages and commit errors because of simple conflicts. Anyway, I will share a solution to one of these headaches. Have you ever gotten this when you tried to pull your code from the server?

error: unable to create temporary sha1 filename .git/objects/de: File exists

In this case, it was my bad I guess. The solution is very simple. Just chown your .git directory recursively to the respective user/group or even your whole repository if you want. For example in my case:

sudo chown -R joram .git

That will be the end of such errors. But you have many more to come 😀