git status shows fatal: bad object HEAD

try this; it worked for me (Warning: this destroys work that exists only in your local repo):

rm -rf .git

You can use mv instead of rm if you don’t want to lose your stashed commits

then copy .git from other clone

cp <pathofotherrepository>/.git . -r

then do

git init

this should solve your problem , ALL THE BEST

Leave a Comment