Git reset =致命:无法读取树 [英] Git reset = fatal: unable to read tree

查看:2336
本文介绍了Git reset =致命:无法读取树的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人在错误的分支上提交了一个提交,所以我试图移动提交到另一个分支。当我试图回滚提交时,我得到了这个错误:

pre $ git reset $ git reset --hard 9c2de3c0
致命:无法读取树9c2de3c0af09fc07a84ff84b594beb5a6d489181

该对象看起来很好:

  [user @ server gitrepo] $ ls objects / 9c / 2de3c * -al 
-r - r - r-- 1 git git 222 Aug 28 12:09 objects / 9c / 2de3c0af09fc07a84ff84b594beb5a6d489181

为什么不能读取对象,我该怎么做?



编辑:区分我的问题与其他人:




解决方案

我有同样的问题。通过检查和固定磁盘来解决这个问题。有些文件已损坏。


Someone made a commit on the wrong branch so I tried to move the commit to another branch. When I tried to roll back the commit, I got this error:

[user@server gitrepo]$ git reset --hard 9c2de3c0
fatal: unable to read tree 9c2de3c0af09fc07a84ff84b594beb5a6d489181

The object looks fine:

[user@server gitrepo]$ ls objects/9c/2de3c* -al
-r--r--r-- 1 git git 222 Aug 28 12:09 objects/9c/2de3c0af09fc07a84ff84b594beb5a6d489181

Why can't it read this object, and what do I do about that?

Edit: to distinguish my problem from others:

  • Git's database doesn't appear to be particularly out of sorts. Running git fsck -full shows only a few (~20) dangling blobs and one dangling commit. Which does not seem particularly alarming.

解决方案

I've got the same problem. Solved it by checking and fixing disk. Some files were corrupted.

这篇关于Git reset =致命:无法读取树的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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