我该如何恢复我的Git存储库以查找“缺失的树”错误? [英] How can I recover my Git repository for a "missing tree" error?

查看:260
本文介绍了我该如何恢复我的Git存储库以查找“缺失的树”错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用Gerrit作为我们的Git存储库。在一个活动了好几个月的项目上,我们突然无法推动任何改变。当我们执行 git push 时,我们看到如下错误:
$ b

error:unpack failed:错误树14d62f0ed4385e3f68f226ac133fa9932a9c65c9



执行 git fsck --full yield:

 悬空树2701c92fb6eab1826482f6bcc9598413e651a92a 
悬空团块c505b3b12cfacd1e26dec8dc559820a30fc20c27
悬空团块8907f94b5b4ec881e1b86d50681795e368c167ff
悬空团块4938d9fc34c6e2f92c68872bfec6e070b2b3a9c2
悬空斑点8a5c8b8d35484ea1470e2d8e6c482fcb97b23d0f
悬空提交3072d3314e20bf6c6998e1c02986d83019d3e1df
悬空树5377d7f7111d340854c3ee0946667c202227e603
悬空树c3783e9ab540457924ceb9f9fb5ea1c2b97472b1
悬空团块8b92d1765038e4ec5e721f98a2aabb305a7f9819
悬空树38a03153f0f18ca15846e9bd4983a86800a43a94
悬空提交8db2d6ae5364174bebe13720a359ddb2e62d4c9d

我们所有的开发者elopers在尝试推送时遇到同样的错误。到目前为止,我们已经尝试重新初始化gerrit repo(git init --bare ...)并推动它。我们也尝试使用单独的回购来创建新的gerrit项目。最后,我们不断收到相同的错误。



有没有人知道原因是什么,或者如何恢复?

$ b $使用 git push --no-thin 而不是 git push

从Git文档:


当发送者和接收者共享许多相同的对象时发送的数据量。默认值是--thin。



We are using Gerrit for our Git repository. On a project that has been active for several months, we are suddenly unable to push any changes. When we execute git push we see the following error:

error: unpack failed: error Missing tree 14d62f0ed4385e3f68f226ac133fa9932a9c65c9

Executing git fsck --full yields:

dangling tree 2701c92fb6eab1826482f6bcc9598413e651a92a  
dangling blob c505b3b12cfacd1e26dec8dc559820a30fc20c27  
dangling blob 8907f94b5b4ec881e1b86d50681795e368c167ff  
dangling blob 4938d9fc34c6e2f92c68872bfec6e070b2b3a9c2  
dangling blob 8a5c8b8d35484ea1470e2d8e6c482fcb97b23d0f  
dangling commit 3072d3314e20bf6c6998e1c02986d83019d3e1df  
dangling tree 5377d7f7111d340854c3ee0946667c202227e603  
dangling tree c3783e9ab540457924ceb9f9fb5ea1c2b97472b1  
dangling blob 8b92d1765038e4ec5e721f98a2aabb305a7f9819  
dangling tree 38a03153f0f18ca15846e9bd4983a86800a43a94  
dangling commit 8db2d6ae5364174bebe13720a359ddb2e62d4c9d  

All of our developers are experiencing the same error when they try to push. So far, we've tried re-initializing the gerrit repo (git init --bare ...) and pushing up to it. We've also tried creating a new gerrit project with a separate repo. In the end, we keep getting the same error.

Does anyone have any insight on what the cause would be, or how to recover?

解决方案

Use git push --no-thin instead of git push.

From Git docs:

A thin transfer significantly reduces the amount of sent data when the sender and receiver share many of the same objects in common. The default is --thin.

这篇关于我该如何恢复我的Git存储库以查找“缺失的树”错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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