本文介绍了git状态显示致命:坏对象HEAD的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows Azure上遇到了git问题。 Git状态显示 - fatal:bad object HEAD,我尝试运行

  git fsck --full 
git gc

git fsck显示

 从从提交9c7eae5ffed34dbfac977e515dee675626b59f93 
提交4a49af0a0cb64a0a0415734b11772d6df18561fb提交9c7eae5ffed34dbfac977e515dee675626b59f93
键树400132d215ab9aced883a9971e648b82624b2032
断开的链接提交739df633f185ce5d1ab7eb97d619b28e7d81185a
键树2a6d4876d135c1fa7cbe1348c62570006e895fc5
断开的链接无效链接从从提交6b34795c4b54286301bcdc0ed254a04c132cb2ad
犯d3bb4f8545e91ec8ace15ad31a3147d92a1d4242
到树4682108accd8e72fe68858232386dffe60f9f02d
断开的链接提交bc3072f30e71c616a8196089e19a67a2c9c0a5ad
到树0aa813c183487d0a1b1f7ae81501ca7a1168283f
断开的链接
断链从提交d70172d855391b93bc1c5eeb9b4226df525dfc6e
树5c57dd3222d11924dba841d3cae517bdc9220601
损坏的链接提交390c8cbd527c8e707c51e25142e54421f4dd3948
断开的链接从提交cc05e8d2e3733693ebb67d697ae4b65e51fea79a
犯从树上6a75ed6d0311d800078e77f43d427d128372d5bc
32f081f8b901425fd1e8898478f0551970bee0f5
断链成团块从树6a75ed6d0311d800078e77f43d427d128372d5bc
4a064d610c0e7207967d59934c8bc5f491f26dae
损坏的链接,从树b4855fa6734b5652a93a9b799eafe47fad0d13a0
树5c06ec964dcbade49287d0f36efe1f7b60f446e3
断链成团块3e1fb421613dc9066cbf9c95eddc61619a9f8eed
断从树b4855fa6734b5652a93a9b799eafe47fad0d13a0
到树556a50048d42346c283c94b78ea278ba1d57d251 $链接b $ b从树上断开的链接289c03409370c4ca7c12266ce2822a2976bd032b
到从树289c03409370c4ca7c12266ce2822a2976bd032b
一滴3abf3c48ada45f63404dcf4d675ddfdadcfa83c6
断链成团块3fa569892003b468ed1301426dd6d96d9644be3c从树289c03409370c4ca7c12266ce2822a2976bd032b

断链成团块从树上289c03409370c4ca7c12266ce2822a2976bd032b
0a9a54a51e84f3bc34122dbce1146d895fcbe22c
断链成团块3fa48873564361b4d95830803ae77f79eeafaf5b

git分支显示 - * master

任何帮助感激!

解决方案

您的存储库已损坏。这意味着数据丢失,git本身无法恢复。如果你有另一个这个仓库的克隆,你可以从那里恢复对象,或者创建一个新的克隆。


$ b

fatal:bad object HEAD 表示从HEAD引用的分支指向一个错误的提交对象,这可能意味着它丢失或损坏。



git fsck ,你可以看到缺少一些树,blob和commit对象。

请注意,使用git本身不足以保证数据安全。您仍然需要在发生讹误的情况下进行备份。


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

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

Any help is appreciated !

解决方案

Your repository is corrupt. That means data is lost that cannot be recovered by git itself. If you have another clone of this repository, you can recover the objects from there, or make a new clone.

fatal: bad object HEAD means the branch referenced from HEAD is pointing to a bad commit object, which can mean it's missing or corrupt.

From the output of git fsck, you can see there are a few tree, blob and commit objects missing.

Note that using git itself is not enough to keep data safe. You still need to back it up in cases of corruption.

这篇关于git状态显示致命:坏对象HEAD的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-04 20:58