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

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

22,970 views 26 12
Join discussion

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