How to migrate a non standard svn repository to Bitbucket

We are planning to migrate hydra svn repository to Bitbucket and the svn repository does not have standard folder structure with the branches, tags, trunk, etc.
We cannot relate the existing folders in svn repository to branches, trunk, etc to migrate to the relevant folders on Git or Bitbucket.
Can you help us how to take this forward?


Hello Santosh,

it’s not mandatory to have this standard SVN directories structure, almost any layout can be translated to Git, the crucial thing is to provide SVN Mirror add-on with a correct mapping configuration. SVN Mirror add-on provides a possibility to scan the history and detect (that is the Automatic Configuration setting in the Subversion Project Layout section), but it requires a trunk directory to be selected – it’s actually not a directory with the name trunk, it can has any name, the idea is that it should be a directory representing a “main line of development”. Once it’s selected, the add-on will scan the repository history and create a mapping configuration.
If the automatically created configuration does not reflect the repository structure well enough, then the mapping can be edited manually. Here is a guide that describes how the mapping can be set:

TMate SubGit: Branches and tags mapping

but don’t hesitate reaching out to us had you got any issues with that, of course.

Hi Idar,

Thank you for the suggestion and we started the import with “dev” folder as the trunk.
However the import fails with the following.

Command Failed : Hydra / hydra_f

The following layout options conflict (intersect) in configuration file '/xxxx/shared/data/subgit/repositories/1483/subgit':
	svn.tags = tags/*:refs/tags/*
	svn.branches = */_:refs/heads/*.
Please specify non-conflicting options and try again.

The Branches Mapping section is provided with the following inputs.

Branches mapping:
# Subversion to Git mapping options
    # Options below (trunk, branches, tags, shelves) define correspondence between Subversion
    # directories and Git references. Depending on the actual Subversion project layout and whether
    # all or only some of the branches have to be mirrored, these options might need to be adjusted.
    #  Generic mapping syntax is:
    #    <Subversion-Path-Pattern>:<Git-Reference-Pattern>
    #  Subversion paths are relative to the URL defined by the svn.url option.
    #  For more details refer to pages.
    trunk = dev:refs/heads/master
    branches = */_:refs/heads/*
    branches = hydra/dev:refs/heads/hydra/dev
    tags = tags/*:refs/tags/*
    shelves = shelves/*:refs/shelves/*
    triggerGitGC = false

Can you please help with this issue?

Hi Santosh,

those two mappings intersects indeed:

svn.tags = tags/*:refs/tags/*
svn.branches = */_:refs/heads/*.

the matter is that the second one that starts with asterisk * covers all the directories at the first level of directories hierarchy thus including the tags directory – and that’s the intersection.
To resolve that issue this intersection must be eliminated. As of my understanding, that second line is not correct since this mapping literally means “all the second-level directories with the name ‘_’ that reside in any directory in the repository” – is that the mapping you intended to express? If not, then this line should be replaced with another mapping that would reflect the mapping more precisely, probably, with a direct (non-wildcarded) mapping.

Hi Ildar,

The folder structure is as follows.

The dev folder is the trunk and the other three folders doc, rel and tst should be branches.

Can you provide the mapping for this requirement?

sure, it can be set like this:

trunk = dev:refs/heads/master
branches = doc:refs/heads/doc
branches = rel:refs/heads/rel
branches = tst:refs/heads/tst
tags = tags/*:refs/tags/*
shelves = shelves/*:refs/shelves/*
triggerGitGC = false

Note, that since there’s no tags directory, no tags will be imported from SVN; but if a mirror is established and a tag is created in Git, it will be sent to SVN and appear in that directory.