Git aborting – could not detach head / sudden permission problems on OSX Lion

Somehow my git broke over night (computer has not even reset) causing this cryptic error.
After digging, I noticed that my project directory is now owned by root

All I got was “aborting” as a message when I tried to pull in changes from remote. It didn’t even give a hint as to what was wrong.

When I tried to check out, I got a better error message: “could not detach head”.
Google searches lead me to believe it’s a permission issue.

I look around and notice that ls -l shows my git folder owned by root.

sudo chown -R me my_project

Done!

Leave a Comment