如何解决从树到树的GIT错误断开的链接? [英] How to fix git error broken link from tree to tree?

查看:188
本文介绍了如何解决从树到树的GIT错误断开的链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到了一个事务中断,当我再次尝试时,我遇到了空的或损坏的对象的错误,接着出现另一个问题,我删除了所有空文件,当我运行时

  git fsck --full 

我得到这个错误

 检查对象目录:100%(256/256),完成。 
检查对象:100%(48774/48774),完成。
错误:d193ccbc48a30e8961e9a2515a708e228d5ea16d:在缓存树
错误无效SHA1指针:df084ac4214f1a981481b40080428950865a6b31:从树4bf4869299b294be9dee4ecdcb45d2c204ce623b
到树df084ac4214f1a981481b40080428950865a6b31
缓存树
断开链接无效SHA1指针从树4bf4869299b294be9dee4ecdcb45d2c204ce623b
损坏的链接,以树d193ccbc48a30e8961e9a2515a708e228d5ea16d
缺少树df084ac4214f1a981481b40080428950865a6b31
丢失一滴a632281618ca6895282031732d28397c18038e35
缺少树d193ccbc48a30e8961e9a2515a708e228d5ea16d
丢失一滴70aa143b05d1d7560e22f61fb737a1cab4ff74c6
丢失一滴c21c0545e08f5cac86ce4dde103708a1642f23fb
缺少blob 9f341b8a9fcd26af3c44337ee121e2d6f6814088
缺少blob 396aaf36f602018f88ce985df85e73a71dea6f14
缺少blob 87b9d1933d37cc9eb7618c7984439e3c2e685a11

并且知道我不知道我该如何修复这个问题。

解决方案

使用Git 2.10(2016年第3季度),您可以更多地了解这些断开连接的来源。 p>

  git fsck --name-objects 

请参阅提交90cf590 commit 1cd772c commit 7b35efd commit 993a21b (17 2016年7月)通过 Johannes Schindelin( dscho 。< br>
(由 Junio C Hamano - gi合并tters - commit 9db3979 中, 25七月2016)


fsck :可选显示更有用的信息对于断开的链接



当报告提交/树/斑点之间断开的链接时,如果告诉用户该对象应该如何可达。
$ b 使用新的 - name-objects 选项, git-fsck code>会尽量做到这一点:

以一种显示它们如何到达的方式命名对象。



例如,当某些reflog被损坏并且丢失了不应该存在的blob时,用户可能需要删除相应的reflog条目。

此选项帮助他们找到该条目: git fsck -




 从树b5eb6ff ...(refs / stash @ {< date>}〜37 :) 
到blob ec5cf80 ...

如果这些损坏的链接不是来自本地存储,而是来自远程存储库,获取这些包对象可以解决这种情况

另请参阅如何恢复Git对象受硬盘故障损坏?


I got a transaction interrupted and when I try again I was having error with objects that were empty or corrupted, following another question I delete all the empty files and when I run

git fsck --full 

I got this error

Checking object directories: 100% (256/256), done.
Checking objects: 100% (48774/48774), done.
error: d193ccbc48a30e8961e9a2515a708e228d5ea16d: invalid sha1 pointer in cache-tree
error: df084ac4214f1a981481b40080428950865a6b31: invalid sha1 pointer in cache-tree
broken link from    tree 4bf4869299b294be9dee4ecdcb45d2c204ce623b
          to    tree df084ac4214f1a981481b40080428950865a6b31
broken link from    tree 4bf4869299b294be9dee4ecdcb45d2c204ce623b
          to    tree d193ccbc48a30e8961e9a2515a708e228d5ea16d
missing tree df084ac4214f1a981481b40080428950865a6b31 
missing blob a632281618ca6895282031732d28397c18038e35
missing tree d193ccbc48a30e8961e9a2515a708e228d5ea16d
missing blob 70aa143b05d1d7560e22f61fb737a1cab4ff74c6
missing blob c21c0545e08f5cac86ce4dde103708a1642f23fb
missing blob 9f341b8a9fcd26af3c44337ee121e2d6f6814088
missing blob 396aaf36f602018f88ce985df85e73a71dea6f14
missing blob 87b9d1933d37cc9eb7618c7984439e3c2e685a11

And know I don't know how could I fix this problem.

解决方案

With Git 2.10 (Q3 2016), you can know more about the origin of those broken links.

git fsck --name-objects

See commit 90cf590, commit 1cd772c, commit 7b35efd, commit 993a21b (17 Jul 2016) by Johannes Schindelin (dscho).
(Merged by Junio C Hamano -- gitster -- in commit 9db3979, 25 Jul 2016)

fsck: optionally show more helpful info for broken links

When reporting broken links between commits/trees/blobs, it would be quite helpful at times if the user would be told how the object is supposed to be reachable.

With the new --name-objects option, git-fsck will try to do exactly that:
name the objects in a way that shows how they are reachable.

For example, when some reflog got corrupted and a blob is missing that should not be, the user might want to remove the corresponding reflog entry.
This option helps them find that entry: git fsck --name-objects will now report something like this:

broken link from    tree b5eb6ff...  (refs/stash@{<date>}~37:)
              to    blob ec5cf80...

If those broken links don't come from a local stash but a remote repo, fetching those pack objects can then solve the situation.
See also "How to recover Git objects damaged by hard disk failure?".

这篇关于如何解决从树到树的GIT错误断开的链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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