git svn clone specific branches and merge

后端 未结 2 1214
后悔当初
后悔当初 2021-01-28 14:13

I am looking to migrate my codebase from svn to git. There are too many branches in my svn repo. I only wish to clone couple of branches and merge them together and push it to g

2条回答
  •  后悔当初
    2021-01-28 15:03

    I think SubGit tool might be the best solution for your case:

    https://subgit.com

    It allows translating data from SVN to Git including and excluding any branches/tags or even directories inside, so it's easy to get only those branches you want to have in Git. Say, if you have branches 'branch_1'… 'branch_N', but intend to have in Git only 'branch_3' and 'branch_4' (along with 'trunk'), then you can set SubGit as follows:

    [svn]
    
    trunk=trunk:/refs/heads/master   
    branches=branches/branch_3:/refs/heads/branch_3   
    branches=branches/branch_4:/refs/heads/branch_4
    

    and only those branches will appear in Git.

    SubGit supports continuous two-way mirror between SVN and Git, so it's perfectly possible not only get updates from SVN, but send those from Git, too. It also possible to only get updates from SVN by running import periodically, yet in this case, branches that came from SVN should not be changed in GIt.

提交回复
热议问题