git commit停止工作 - 构建树时出错 [英] git commit stopped working - Error building trees

查看:292
本文介绍了git commit停止工作 - 构建树时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法提交更改:

I can not commit a change:

$ git commit
error: invalid object 100644 13da9eeff5a9150cf2135aaed4d2e337f97b8114 for 'spec/routing/splits_routing_spec.rb'
error: Error building trees

到目前为止,

$ git fsck | grep 13da
missing blob 13da9eeff5a9150cf2135aaed4d2e337f97b8114

还有:

and also:

$ git prune
error: Could not read 1394dce6fd1ad15a70b2f2623509082007dc5b6c
fatal: bad tree object 1394dce6fd1ad15a70b2f2623509082007dc5b6c

还有:

and also:

$ git fsck | grep 13da
missing blob 13da9eeff5a9150cf2135aaed4d2e337f97b8114

但没有任何帮助。我应该删除文件,提交并重新返回?如果它将git提交回来,我愿意失去一点历史。

but nothing helped. Should I delete the file, commit and reintroduce back? I am willing to lose little bit of history if it brings git commit back.

推荐答案

您的git中可能有损坏的对象

You might have a corrupted object in your git repository.

如果您有远程存储库或其他存储库的克隆,那么您可以从那里获取有问题的文件,并将其替换到本地存储库中。

If you have a remote, or other clones of this repository, you could grab from there the problematic file and just replace it on your local repo.

您需要的文件位于:

/repo/.git/objects/13/da9eeff5a9150cf2135aaed4d2e337f97b8114

这篇关于git commit停止工作 - 构建树时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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