Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fatal: not a git repository - after BSoD

Tags:

git

windows

I was committing and then my Windows ( .. :( ) machine crashed and presented me with the lovely and infamous Blue Screen of Death. I rebooted and went right back to work, only to discover that something's seriously wrong with my local git repo.

"Fatal: not a git repository"

... Well, that escalated quickly.

I've been reading up on this issue (also here on StackOverflow), but haven't found a solution yet. The things I did include:

  • git init (says within 0.1s: Reinitialized existing Git repository)
  • git status (gives same fatal error)
  • git push origin develop (same fatal error)

The .git folder is still there and looks normal (although I wouldn't directly spot any anomalies).

It looks like there's nothing I can do on the command line to revive my repository.

I have found this reference, but I have no idea how to "change HEAD to a valid ref/hash".

Is there anyone who knows where to go from here?

(I know this questions shows up multiple times on SO, but none of those problems have the same origin and their solutions don't work. Please be sure this question really is a duplicate if you mark it as such.)

like image 596
Sherlock Avatar asked Jul 18 '13 11:07

Sherlock


1 Answers

(I'm the asker.)

Unfortunately I didn't have the time to solve this problem in time. The pressure in this project is on and I needed to continue. I decided to do a complete new checkout. Everything works fine again.

Lesson learned: never get a BSoD while committing.

like image 180
Sherlock Avatar answered Sep 19 '22 11:09

Sherlock