Changing SVNgit branch mapping in SVN-mirror

I have a previously working SVN-Mirror using the default mapping which maps TRUNK to master. On the svn side branches are not used and on the git side branches are used for development lifecycle management (i.e. develop->release->master<->hotfix). It's not likely the svn project is going to restructure their repository. How can I at lease change the mapping to be svn.TRUNK<->git.develop? I would like to keep development commits off of the master branch since we use that for production commits.

1 answer

1 accepted

0 votes
Answer accepted

Hello Dennis,

It is impossible to change branch mappings for established Git-SVN mirror, so you have to start with an empty Git repository and re-import your Subversion repository with proper settings.

Please specify the following values in order to map 'trunk' to 'develop' branch in Git repository:

url = <SVN_URL>

trunk = trunk:refs/heads/develop

branches = branches/*:refs/heads/*

shelves = shelves/*:refs/shelves/*

tags = tags/*:refs/tags/*

Note that you can map certain branches explicitly, e.g.:

branches = branches/stable:refs/heads/master; branches/*:refs/heads/*

Another thing I'd like to mention is that although you don't use branches on Subversion side, I'd still recommend to keep them synchronized with Git. By design SubGit plugin synchronizes every single branch found in Git repository. If some Git branch doesn't have configured mapping, then the plugin automatically sends that branch to shelves/<auto_generated_branch_name>. So, it's better to specify all the existing branch mappings to avoid those auto-generated shelf-branches.

Hope that helps,


Thanks for you help and explanation.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Thursday in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder :  #!/bin/bash source "$(dirname "$0")/" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables ROLLBAR_ACCESS_TOKEN...

177 views 0 11
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you