怀疑硬盘问题后 Git 分支损坏

发布于 2024-12-07 03:00:18 字数 691 浏览 0 评论 0原文

所以我的硬盘有问题(我认为)。每次我运行 git log 命令(通过 VMWare Fusion for Mac 运行 Windows 时),都会抛出致命错误,导致 VMWare 崩溃(无法访问磁盘驱动器)。即使我本机启动到 Boot Camp 并尝试运行 git log,我也会收到一些有关 less.exe 失败的错误。

我无法毫无问题地复制/删除 git/bin 文件夹中的任何文件(VMWare 崩溃)。所以我尝试安装最新的 git (1.6.4 中的 1.6.7)。完成此操作后,我可以再次成功运行 git log 命令,一切似乎都正常。

在最初的崩溃发生之前,我正在开发的一个分支有很多变化。现在,当我尝试签出该分支时,出现以下错误:

错误:无法解压 d7a66a887fbe9b5f2baec0580da1fb4c1f39851e 标头 错误:inflateEnd:失败 致命:松散对象 d7a66a887fbe9b5f2baec0580da1fb4c1f39851e (存储在 .git/objects/d7/a66a887fbe9b5f2baec0580da1fb4c1f39851e 中)已损坏。

如果我执行 git cat-file -t d7a66a887fbe9b5f2baec0580da1fb4c1f39851e,我会收到类似的错误。我在另一个帖子上看到了这个。我的分支还没有被推送到网络存储库,因为我只是在本地处理它。有机会恢复/修复这个分支吗?我非常不想丢失这段代码:(

So I was having a problem with my hard disk (I think). Everytime I ran git log commands (when running Windows through VMWare Fusion for Mac) it would throw a fatal error causing VMWare to crash (something about unable to reach disk drive). Even if I booted to Boot Camp natively and tried running git log, I got some error about less.exe failing.

I couldn't copy/delete any files in the git/bin folder without problems (VMWare crashing). So I tried to just install the latest git (1.6.7 from 1.6.4). After doing this, I could successfully run git log commands again and everything seemed to be working.

Before the original crash had occurred, I had a branch I was working on that has a lot of changes. Now when I try to checkout that branch, I get the following error:

error: unable to unpack d7a66a887fbe9b5f2baec0580da1fb4c1f39851e header
error: inflateEnd: failed
fatal: loose object d7a66a887fbe9b5f2baec0580da1fb4c1f39851e (stored in .git/objects/d7/a66a887fbe9b5f2baec0580da1fb4c1f39851e) is corrupt.

I get similiar error if I do git cat-file -t d7a66a887fbe9b5f2baec0580da1fb4c1f39851e. I saw this on another post. My branch had not been pushed to the network repository yet as I was only working on it locally. Any chance of recovering/fixing this branch? I'm desperate to not lose this code :(

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文