Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

github - git status shows fatal: bad object HEAD

I have a problem with git on Windows Azure. Git status shows - "fatal: bad object HEAD" and I tried running:

 git fsck --full
 git gc

But git fsck shows:

broken link from  commit 739df633f185ce5d1ab7eb97d619b28e7d81185a
              to    tree 2a6d4876d135c1fa7cbe1348c62570006e895fc5
broken link from  commit 9c7eae5ffed34dbfac977e515dee675626b59f93
              to    tree 400132d215ab9aced883a9971e648b82624b2032
broken link from  commit 9c7eae5ffed34dbfac977e515dee675626b59f93
              to  commit 4a49af0a0cb64a0a0415734b11772d6df18561fb
broken link from  commit bc3072f30e71c616a8196089e19a67a2c9c0a5ad
              to    tree 0aa813c183487d0a1b1f7ae81501ca7a1168283f
broken link from  commit d3bb4f8545e91ec8ace15ad31a3147d92a1d4242
              to    tree 4682108accd8e72fe68858232386dffe60f9f02d
broken link from  commit 6b34795c4b54286301bcdc0ed254a04c132cb2ad
              to    tree 5c57dd3222d11924dba841d3cae517bdc9220601
broken link from  commit d70172d855391b93bc1c5eeb9b4226df525dfc6e
              to  commit 390c8cbd527c8e707c51e25142e54421f4dd3948
broken link from  commit cc05e8d2e3733693ebb67d697ae4b65e51fea79a
              to  commit 32f081f8b901425fd1e8898478f0551970bee0f5
broken link from    tree 6a75ed6d0311d800078e77f43d427d128372d5bc
              to    blob 4a064d610c0e7207967d59934c8bc5f491f26dae
broken link from    tree 6a75ed6d0311d800078e77f43d427d128372d5bc
              to    tree 5c06ec964dcbade49287d0f36efe1f7b60f446e3
broken link from    tree b4855fa6734b5652a93a9b799eafe47fad0d13a0
              to    blob 3e1fb421613dc9066cbf9c95eddc61619a9f8eed
broken link from    tree b4855fa6734b5652a93a9b799eafe47fad0d13a0
              to    tree 556a50048d42346c283c94b78ea278ba1d57d251
broken link from    tree 289c03409370c4ca7c12266ce2822a2976bd032b
              to    blob 3abf3c48ada45f63404dcf4d675ddfdadcfa83c6
broken link from    tree 289c03409370c4ca7c12266ce2822a2976bd032b
              to    blob 3fa569892003b468ed1301426dd6d96d9644be3c
broken link from    tree 289c03409370c4ca7c12266ce2822a2976bd032b
              to    blob 0a9a54a51e84f3bc34122dbce1146d895fcbe22c
broken link from    tree 289c03409370c4ca7c12266ce2822a2976bd032b
              to    blob 3fa48873564361b4d95830803ae77f79eeafaf5b

git branch shows - *master

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

try this : worked for me rm -rf .git

You can use mv instead of rm if you don't want to loose 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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...