如何解决git-svn索引不匹配? [英] How do I resolve a git-svn index mismatch?
问题描述
索引不匹配:树的SHA键!= SHA键。
(我知道这些SHA键对应于一棵树,而不是上面两个sha键的git show的提交。)
重新读取< svn / trunk中提交的sha索引>
...文件列表...
致命错误对象<不良对象的SHA1索引>
rev-list -1<不良对象的SHA1索引> - 不是<尝试重新读取的版本的SHA1索引> ;:命令返回的错误:128
我对git的内部工作经验不是很熟悉,那么是否有一系列步骤可以解决像这样的问题并可能解决它们?
我有两次这个错误,两次都通过删除.git文件夹中的svn文件夹来解决它。
rm -r .git / svn
然后用以下方法重建svn元数据:
git svn fetch
您可能会看到如下消息:
从git-svn v1版面迁移.. 。
存在git-svn以前版本的数据,但
.git / svn
(git-svn的此版本(1.7.0.4)需要)不存在。
完成从git-svn v1布局迁移
以及while(重建可以采取特别是在大型软件仓库中),您应该再次获得svn仓库的工作镜像。
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.
(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
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?
I've had this error twice and both times resolved it by removing the svn folder inside the .git folder.
rm -r .git/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
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屋!