问题描述
作为我们迁移计划的一部分,我正在将一个 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
我找到了 this related answer,但是该解决方案不起作用,因为 git svn log
还没有功能,因为 repo 还没有完全到位:
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
我该如何继续?
推荐答案
对一个老问题的另一个答案,但对于这个问题很难找到直截了当的解决方案,所以希望这对其他人有所帮助.
Another answer to an old question but straight forward solutions are tough to find for this problem so hopefully this helps others.
我认为此问题是由于传输过程中文件损坏所致.不知道它是如何发生的或为什么会发生,但就我而言,每次我进行新的克隆时都会在不同的修订版中遇到相同的错误,有时根本不会.
I think this issue occurs due to a corrupted file during transfer. Not sure how or why it happens, but in my case, I get the same error at different revisions every time I do a new clone and sometimes not at all.
使用提问者错误信息
$ git svn fetch
Checksum mismatch: dc/trunk-4632-jh/dc-smtpd/lib/Qpsmtpd/Address.pm.t
8ce3aea3f47dc115e8fe53bd62d0f074cfe93ec6
expected: 59de969022e46135fa6dc7599fc2f3b4
got: 4334926a01c905cdb7fce71265e370c1
以下步骤使我能够恢复和进步:-
The following steps allowed me to resume and progress :-
查看所有分支.这些都将是远程分支.git 分支 -a
结帐分支受到影响.git checkout remotes/origin/trunk-4632-jh
Checkout branch affected. git checkout remotes/origin/trunk-4632-jh
这需要一些时间才能完成.
This will take some time to complete.
查找问题文件被更改的最后一个版本.git svn log dc-smtpd/lib/Qpsmtpd/Address.pm.t
Find the last revision that the problematic file was changed. git svn log dc-smtpd/lib/Qpsmtpd/Address.pm.t
注意最高版本#
重置回这个版本.git svn reset -r (rev #) -p
Reset back to this rev. git svn reset -r (rev #) -p
继续.git svn fetch
祝你好运.
这篇关于在与“git svn clone"校验和不匹配后如何恢复?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,WP2