From: Egon Elbre Date: Fri, 17 Aug 2012 11:42:33 GMT Subject: Having an invalid HEAD file causes git not to recognize the repository Message-ID: Having an invalid HEAD file causes git not to recognize the repository and will cause an invalid message "fatal: Not a git repository (or any of the parent directories): .git" although there is a .git folder and everything seems okay in it. Solution was just to change HEAD to a valid ref/hash. I ran into this problem when I had a BSOD during a rebase (ignore that I'm having to use Windows). This meant that only half of the hash got written into HEAD and all git commands I tried failed. Not sure whether it's useful to add a better message for this case, but at least if somebody stumbles on it again, maybe they can find this text. + egon