Svn - >与几个干线/分支/标签的git迁移 [英] Svn -> git migration with several trunk/branches/tags

查看:234
本文介绍了Svn - >与几个干线/分支/标签的git迁移的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个SVN仓库,它包含以下当前结构:


  • project1


    • 分行

    • 行李箱

    • 标记

    • 项目2


      • 分行

      • 行李箱
      • $ b $ 这个结构:


        • 项目


          • 分支

          • 中继线


            • proj1

            • proj2


          • 标签




        该项目分为两个独立的子库(或任何你想要的)



        有没有办法将这个迁移到git 而不会丢失历史
        在这种情况下,svn2git会比git-svn更好吗?是否有其他迁移工具?



        编辑:我尝试了git svn clone,但是,正如我所想的那样,它没有遵循从旧结构转移到新结构。它只从新结构导入了修订版本。

        解决方案

        首先,我将主干转换为git:

          git svn clone url-to-project -s 

        然后我转换每个项目:

          git svn clone url-to-project1 -s 
        git svn clone url-to-project2 -s
        ...

        然后对每个项目我使用移植和过滤分支从主干连接了以前的历史记录。



        我只是博客有关


        I have a single SVN repository with the following current structure:

        • project1
          • branches
          • trunk
          • tags
        • project2
          • branches
          • trunk
          • tags

        which originally had this structure:

        • project
          • branches
          • trunk
            • proj1
            • proj2
          • tags

        That is, the project was split into two separate "subrepositories" (or whatever you want to call that)

        Is there any way to migrate this to git without losing history? Would svn2git be better that git-svn for this scenario? Is there any other migration tool?

        EDIT: I tried git svn clone as suggested but, as I thought, it didn't follow the move from the old structure to the new one. It only imported the revisions from the new structure.

        解决方案

        First I converted the main trunk to git:

        git svn clone url-to-project -s
        

        Then I converted each project:

        git svn clone url-to-project1 -s
        git svn clone url-to-project2 -s
        ...
        

        Then for each project I attached the previous history from the main trunk using grafts and filter-branch.

        I just blogged about it.

        这篇关于Svn - >与几个干线/分支/标签的git迁移的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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