校验和与"git svn clone"不匹配后,如何恢复? [英] How can I recover after a checksum mismatch with 'git svn clone'?

查看:297
本文介绍了校验和与"git svn clone"不匹配后,如何恢复?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作为我们的迁移计划的一部分,我正在将SVN存储库克隆到git中.在此过程中,我遇到了许多障碍,迫使我使用git svn fetch命令继续克隆.我不知道该如何解决的最近一次失败:

I'm cloning an SVN repository to git as part of our migration plan. I've hit various snags along the way, forcing me to continue the clone with a git svn fetch command. The most recent failure I can't figure out how to solve:

$ git svn fetch
Checksum mismatch: dc/trunk-4632-jh/dc-smtpd/lib/Qpsmtpd/Address.pm.t 8ce3aea3f47dc115e8fe53bd62d0f074cfe93ec6
expected: 59de969022e46135fa6dc7599fc2f3b4
     got: 4334926a01c905cdb7fce71265e370c1

我找到了这个相关的答案,但是该解决方案不起作用,因为git svn log尚不起作用,因为回购协议尚未完全到位:

I found this related answer, however that solution doesn't work because git svn log is not yet functional, as the repo is not fully in place:

$ git svn log dc/trunk-4632-jh/dc-smtpd/lib/Qpsmtpd/Address.pm.t
fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions
log --no-color --first-parent --pretty=medium HEAD: command returned error: 128

我该如何进行?

推荐答案

我知道这已经很老了,但也许对将来的参考会有所帮助,因为与此相关的所有搜索结果都无济于事.

I know this is old but maybe it will be helpful for future reference as all search results on this are not helpful.

我在庞大的存储库中遇到了类似的问题,这需要几天的时间来克隆,但是不幸的是我不得不重启机器.我目前正在研究如何解决该问题,因此请记住,这不是建议,而是经过测试的解决方案.

I've hit similar issue on our huge repository which takes days to clone and unfortunately at one point I had to restart my machine. I am currently working out how to resolve the problem, so please keep in mind this is more a suggestion than tested solution.

我认为您需要尝试创建一个分支,并从以前的提取中检查当前拥有的提交:

I think you need to try creating a branch and checking out the commits you currently have from previous fetch:

git checkout -b master git-svn

完成此操作后,应该有一个工作树来完成该提交.另一个提取可能会由于对象不匹配而失败,但是至少在那一点上,应该可以使用"git svn reset"还原错误的svn提取(请参阅OP的相关答案链接).如果确实如此,请找出令人反感的提交,在此之前进行重置,然后继续获取.

After that is done you should have working tree up to that commit. Another fetches will probably fail due to object mismatch but at that point at least it should be possible to use "git svn reset" to revert faulty svn fetches (see OP's related answer link). If that's true find offending commit, reset before it and then continue fetching.

如果这是您想要的(在我的情况下),那么您可能想要在主分支上的那个断断续续的提交之前恢复基准并恢复到状态,或者转换回裸存储库.

You might want to rebase and revert to state before that broken commit on your master branch or convert back to bare repository, if that's what you're after (in my case it is).

希望这行得通.结帐完成后,我会发布更新(至少需要几个小时的时间.叹气).

Hope this works. I'll post an update when my checkout is done (will take at least few hours... sigh).

这似乎可行.我成功丢弃了一些git-svn提交,并能够再次重新获取它们. :)

That seemed to work. I successfully discarded some git-svn commits and am able to re-fetch them again. :)

Edit2:确保重置,直到在git svn fetch上没有收到任何对象不匹配警告为止(否则您很快就会遇到相同的问题).

Make sure to reset until you don't get any object mismatch warnings on git svn fetch (otherwise you will run into the same issue soon).

干杯

亨利克

这篇关于校验和与"git svn clone"不匹配后,如何恢复?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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