如何解决 git-svn 索引不匹配? [英] How do I resolve a git-svn index mismatch?

查看:20
本文介绍了如何解决 git-svn 索引不匹配?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我执行 git svn rebase 时,它​​一度停止说:

When I did a git svn rebase it stopped at one point saying:

Index mismatch: SHA key of a tree != SHA key of another tree. (我开始知道这些 SHA 键对应于一棵树而不是上面两个的 git show 提交沙键.)

Index mismatch: SHA key of a tree != SHA key of another tree. (I come to know that these SHA keys corresponds to a tree and not a commit from git show of the above two sha keys.)

re-reading <sha index of a commit in svn/trunk>
... list of files ...
fatal: bad object <SHA1 index of the bad object>
rev-list -1 <SHA1 index of the bad object> --not <SHA1 index of the revision it was trying to re-read>: command returned error: 128

我对 git 的内部工作不是很有经验,那么是否有一系列的步骤来剖析这些问题并可能解决它们?

I am not very experienced in the internal workings of git, so is there a sequence of steps to follow to dissect problems like these and possibly resolve them?

推荐答案

我遇到过两次这个错误,两次都通过删除 .git 文件夹中的 svn 文件夹来解决.

I've had this error twice and both times resolved it by removing the svn folder inside the .git folder.

rm -r .git/svn

然后使用以下命令重建 svn 元数据:

then rebuild the svn metadata with:

git svn fetch

您可能会看到类似以下内容的消息:

You will probably see a message along the lines of:

Migrating from a git-svn v1 layout...
Data from a previous version of git-svn exists, but
    .git/svn
    (required for this version (1.7.0.4) of git-svn) does not exist.
Done migrating from a git-svn v1 layout

一段时间后(重建可能需要一段时间,尤其是在大型存储库上),您应该再次获得 svn 存储库的工作镜像.

and after while (rebuilding can take a while especially on large repositories) you should end up with a working mirror of the svn repository again.

这篇关于如何解决 git-svn 索引不匹配?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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