如何诊断和修复git fatal:无法读取树 [英] How to diagnose and fix git fatal: unable to read tree

查看:284
本文介绍了如何诊断和修复git fatal:无法读取树的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 git 来管理项目中的文件,并继续处理此问题。



当我运行 git status 时,我得到消息

 致命:无法阅读树e2d920161d41631066945a3cbcd1b043de919570 

据我了解,我应该检查 git的输出fsck ,并且我收到

 从树中断开的链接e09a42f248afff64336fbbec2523df97c26451ac 
到树e2d920161d41631066945a3cbcd1b043de919570
从树e09a42f248afff64336fbbec2523df97c26451ac
到树9b0dd389bd7f9e8d257395d57e0881b7957f9698
损坏的链接,以树9e288a4ad60d63f342dfd18237980674426aa725
损坏的链接,以树2a04647337089f554fab8c49cfd37149e5f4fc9f
断开的链接从树e09a42f248afff64336fbbec2523df97c26451ac
。从树e09a42f248afff64336fbbec2523df97c26451ac
来自t的断开链接ree e09a42f248afff64336fbbec2523df97c26451ac
to tree ea16658b45ce961adc3c3f519b0e8d9672918ca8

连同大量缺失blob 消息。



遵循各种资源(例如 Git - 断开的链接,丢失&悬挂树木)我只是从 github 重新克隆项目,然后重新开始。

一旦我重新克隆了这个项目,所有对 commit s都有好处,然后问题出现了再次出现。每次重新克隆似乎都不是最佳的,并且似乎违背了使用 git 的想法,并且我想尝试理解正在发生的事情。我该如何诊断和解决这个问题?

继我的旧建议,它归结为能够找到实际上包含缺失元素的回购(这里是全部树)。

这就是 a href =https://stackoverflow.com/a/18687206/6309>如何修复损坏的git仓库?。



但是,如果完全克隆不能解决问题,那么它可能是:






2016年7月更新,Git 2.10即将发布,您现在拥有:

  git fsck --name-objects 

请参阅如何解决从树到树的git错误断开链接?


I'm using git to manage files on a project, and keep running into this problem.

When I run git status I get the message

fatal: unable to read tree e2d920161d41631066945a3cbcd1b043de919570

As I understand it, I should check the output of git fsck, and I receive

broken link from    tree e09a42f248afff64336fbbec2523df97c26451ac
              to    tree e2d920161d41631066945a3cbcd1b043de919570
broken link from    tree e09a42f248afff64336fbbec2523df97c26451ac
              to    tree 9b0dd389bd7f9e8d257395d57e0881b7957f9698
broken link from    tree e09a42f248afff64336fbbec2523df97c26451ac
              to    tree 9e288a4ad60d63f342dfd18237980674426aa725
broken link from    tree e09a42f248afff64336fbbec2523df97c26451ac
              to    tree 2a04647337089f554fab8c49cfd37149e5f4fc9f
broken link from    tree e09a42f248afff64336fbbec2523df97c26451ac
              to    tree ea16658b45ce961adc3c3f519b0e8d9672918ca8

together with a lot of missing blob messages.

Following various resources (e.g Git - Broken Links, Missing & Dangling Trees) I have simply re-cloned the project from github and started again.

Once I have re-cloned the project, all is good for a few commits, and then the problem arises again. Re-cloning every time doesn't seem to be optimal, and seems to go against the idea of using git, and I'd like to try and understand what is going on. How can I diagnose and fix this problem?

解决方案

Following my older recommendation, it boils down to being able to find a repo which actually contains the missing elements (here full trees).
This is what is shown in "How to fix corrupted git repository?".

But if a full clone doesn't solve the problem, then it may be:


Update July 2016, with Git 2.10 soon to be release, you now have:

git fsck --name-objects

See "How to fix git error broken link from tree to tree?" for more.

这篇关于如何诊断和修复git fatal:无法读取树的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆