0

Below is my svn repository structure

svnrepo

  • trunk
  • branches
  • tags
  • folder1
  • folder2

I want to have trunk content, folder1 and folder2 in git repositories master branch, how can I achieve this using subgit migration?

gitrepo (master)

  • trunk content
  • folder1
  • folder2
  • There are many `svn2git` tools out there. Do you use the proper one, the one the KDE guys created that is found at https://github.com/svn-all-fast-export/svn2git and described in the description of the `svn2git` tag or some other like the nirvdrum `svn2git` that is based on `git-svn` and thus not really suited for producing good migration results? – Vampire Dec 13 '17 at 21:32

1 Answers1

0

As I understand you don't want branches/ and tags/ in Git. In this case you can use the following configuration:

trunk = trunk:refs/heads/master
branches = folder1:refs/heads/folder1
branches = folder2:refs/heads/folder2

You can find more information about trunk/branches/tags/shelves options in branches mapping article. Optionally you can add shelves=shelves/*:refs/shelves/* option if you need bi-directional translation and want to translate every single Git commit to a separate revision in case of self-merges in branches.

Update: the question was about translating trunk and a couple of branches into the same Git branch. I can only propose the following approach:

trunk = :refs/heads/master
includePath = /trunk
includePath = /folder1
includePath = /folder2

It will translate the project root into refs/heads/master but skip everything except these 3 directories. Note that not skipped directories will still be downloaded from SVN but discarded locally later.

This this is the closest solution to your original question, I don't know anything better.

Dmitry Pavlenko
  • 8,530
  • 3
  • 30
  • 38
  • Sorry for misinterpretation. tags and branches are also required, but trunk content, folder1 and folder2 should go to master branch. As per your solution, 2 new branches will be created. Do you mean, after branches are created merge them to master? –  Dec 15 '17 at 14:52