Git failed with a fatal error

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
User avatar
krautersuppe
Posts: 91
Joined: September 14th, 2015, 10:58 pm
Location: Istanbul

Git failed with a fatal error

Post by krautersuppe » March 26th, 2019, 9:39 pm

error: bad signature
fatal: index file corrupt
This came up in my project so I first tried this advice which got me only in more trouble.
After that I tried some stuff that is written here.
That got too complicated for me so i just run

Code: Select all

git reflog
in repo directory and it churned out all my commits and their numbers.
I then reset git to second commit from end with

Code: Select all

git reset --hard commitnumber
It did return my code to normal however corrupt release folder in x64 stayed corrupt.
My project is on external data storage drive so i just run

Code: Select all

chkdsk
on it and it solved the remaining issue.
DSU
Discord: dsu1, GitHub: https://github.com/DSpUz

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: Git failed with a fatal error

Post by albinopapa » March 26th, 2019, 11:22 pm

Geez, hope your HD isn't going out, hopefully you upload to GitHub, Dropbox, ButBucket, OneDrive, etc...
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

User avatar
krautersuppe
Posts: 91
Joined: September 14th, 2015, 10:58 pm
Location: Istanbul

Re: Git failed with a fatal error

Post by krautersuppe » July 10th, 2020, 1:13 pm

So it turns out that even if all changes have been commited, if there is a power-out while visual studio is open it will somehow corrupt the .git folder and after restart local repository is no more in the list and when trying to open solution file it says:

fatal: Not a git repository (or any of the parent directories): .git

After running git init in cmd it shows that : Reinitializing existing git repository in c:/.../../.git/
However after git status it is still fatal: Not a git repository (or any of the parent directories): .git
If I try to copy HEAD from logs then it becomes git status : fatal: bad object HEAD

I am so tilted :evil:

Edit: Ok so after git symbolic-ref HEAD refs/heads/nameoflastcommitedbranch
and some commits and reverts and change of icon it did return to original state
I am still so fucking tilted :evil:
DSU
Discord: dsu1, GitHub: https://github.com/DSpUz

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: Git failed with a fatal error

Post by albinopapa » July 11th, 2020, 3:33 am

Wow, I would be also
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

Post Reply