How to migrate to git an SVN repository with tags created with eclipse IDE

260 Views Asked by At

I am trying to migrate my repository from SVN to git but I experience issues due to the layout (mainly how tags have been created). This is the SVN layout:

svn+ssh://myserver/myproject/
    branches/
    tags/
        myproject_0.0.1/
            <project content> (tag created with command line svn)
        myproject_0.0.2/
            myproject/
                <project content> (tag created with eclipse IDE svn plugin)
        ...
        <many other tags of both types>
    trunk/
        myproject/
            <project content>

Using git svn clone I get the following:

myproject/
    myproject/
        <project content>
    .git/ (git repo)

This is not the standard layout of a git project, which I would like to have. The same applies to tags created with eclipse IDE. I would like to have the following, for both master and tags.

myproject/
    <checked out project content>
    .git/ (git repo)

Is there a way to do this migration properly? Having this mismatches really messes up comparison between versions, checkouts, etc.

1

There are 1 best solutions below

0
ildar.hm On

It definitely can be done with SubGit, only you would need to change the mapping layout for it. For your case, the following should work:

[svn]
    url = svn+ssh://myserver/myproject/
    trunk = trunk/myproject:refs/heads/master
    tags = tags/myproject_0.0.1:refs/tags/myproject_0.0.1
    tags = tags/myproject_0.0.2/myproject:refs/tags/myproject_0.0.2
    …

The rest tags should be set in the same way; and with this configuration, the project content will reside right in the root of a branch in Git. SubGit is free for one-time import, so there's no difference with git svn in that matter.