2

I've been having some strange errors lately. I have a working install of Git, but this is my shell output when committing changes:

$ git commit -m 'Removing crap'
error: unable to append to .git/logs/refs/heads/master
fatal: cannot update HEAD ref
pmr
  • 58,701
  • 10
  • 113
  • 156
rowantran
  • 143
  • 1
  • 5

3 Answers3

6

Check the user and permission on .git/logs/refs/heads/master

This should might fix it it, at least on a unix machine:

sudo chown -Rc $UID .git/
Billjk
  • 10,387
  • 23
  • 54
  • 73
  • I'm pretty sure I have read+write permissions. I opened it in pico, and I was able to write text to it. – rowantran Apr 07 '12 at 20:54
2
chmod 766 .git/logs/HEAD

worked for me

Pa Ddy
  • 107
  • 1
  • 9
0

The ownership can get messed up if you made changes as another user, e.g. root and then tried to push/pull etc. The sudo chown -Rc $UID .git/ fixed it for me too. Make sure that if you have nested .git folders, you make this change in the appropriate repo of your project.

John Ko
  • 19
  • 2