简体   繁体   English

执行git lfs迁移后无法svn rebase

[英]Unable to svn rebase after doing git lfs migrate

I've been migrating a Subversion codebase to Git. 我一直在将Subversion代码库迁移到Git。 All went well and I git svn clone(d) the repo and then git lfs migrate(d) the large and binary files. 一切顺利,我git svn clone(d)仓库,然后git lfs migrate(d)大文件和二进制文件。 The repo looks fine from the Git side but I now cannot git svn rebase ... 回购从Git方面看起来不错,但我现在无法git svn rebase ...

$ git svn rebase Unable to determine upstream SVN information from working tree history $

I've tried various suggestions from the web on solving this problem but they seem to have no effect. 我尝试了网络上有关解决此问题的各种建议,但它们似乎没有效果。 Any suggestions? 有什么建议么? Can I reset the Subversion/Git info? 我可以重置Subversion / Git信息吗? Should I have git lfs install(ed) before doing the git lfs clone ? 我应该在进行git lfs clone之前git lfs install(ed) git lfs clone吗?

The reason git svn indexing is broken when using git lfs import is that the later rewrites the Git repository history (unless the --no-rewrite option is given). 使用git lfs importgit svn索引损坏的原因是,后者会重写Git存储库历史记录(除非给出了--no-rewrite选项)。

If using the --no-rewrite option is viable to you (that is: you can handle keeping the big files in the Git repository history, only removing them from future commits), then maybe it's the easiest way to go. 如果使用--no-rewrite选项对您可行(也就是说:您可以处理将大文件保留在Git存储库历史记录中,仅从将来的提交中删除它们),那么也许这是最简单的方法。

On the other hand, if you must keep those large binary files away from your repository storage entirely, there must be no commit in its history that adds those files directly to Git. 另一方面,如果您必须将那些大的二进制文件完全远离存储库存储,那么在其历史记录中就不能有将这些文件直接添加到Git的提交。 Therefore, you must keep using the plain git lfs import to rewrite all the commits created by git svn clone/fetch and redirect those files to the LFS. 因此,您必须继续使用纯git lfs import来重写git svn clone/fetch创建的所有提交,并将这些文件重定向到LFS。 After running the git lfs import , you will need to regenerate the git-svn rev_map to map the new commits in the rewritten Git history to the SVN revisions they mirror. 运行git lfs import ,您将需要重新生成git-svn rev_map ,以将重写的Git历史记录中的新提交映射到它们镜像的SVN修订版。 I don't know if there is an easy way to do this, but you may have a look at the code in https://github.com/Eloston/git-svn-lfs to have an idea. 我不知道是否有简单的方法可以执行此操作,但是您可以看看https://github.com/Eloston/git-svn-lfs中的代码以了解一个想法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM