Git缺少提交错误 [英] Git Missing Commit error

查看:117
本文介绍了Git缺少提交错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们最近更改了存储库的位置,并且发现文件中缺少一个数月的提交。我们拥有Git的旧服务器已关闭,因此无法从此处恢复提交。

We recently changed the location of a repository, and we discovered a months-old commit is missing from the files. The old server we had the Git on is down, so there is no chance of recovering the commit from there.

以下是我得到的错误:

$ git fsck --full

从提交中断开的链接58ba71d080b1814420bce09c4e505b323fd9cb58

提交a2e2bde363032b7609616a3152fe048cc5c83715

$ git fsck --full
broken link from commit 58ba71d080b1814420bce09c4e505b323fd9cb58
to commit a2e2bde363032b7609616a3152fe048cc5c83715

缺少提交a2e2bde363032b7609616a3152fe048cc5c83715

missing commit a2e2bde363032b7609616a3152fe048cc5c83715

有什么可以解决的吗?谢谢!

Is there anything that can be done to fix this? Thank you!

推荐答案

每个克隆都有完整的历史记录,所以任何从提交发布以来在该项目上工作的人都应该拥有它电脑。查看任何人的工作目录中的提交,然后将它的包和对象( .git / objects 目录的内容)添加到损坏的存储库(仅存在不存在的文件) ,fsck再次重新打包。

Every clone has full history so anyone who worked on that project since the commit was published should have it on their computer. Look inside anyone's working directory for the commit then add it's packs and objects (content of the .git/objects directory) to the broken repository (only files that don't exist), fsck again and repack.

如果您没有在任何地方找到它,则无法重建对象。

It's not possible to reconstruct the object if you don't find it anywhere.

这篇关于Git缺少提交错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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