Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Changing SVNgit branch mapping in SVN-mirror

Dennis Biringer March 19, 2014

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
Semyon Vadishev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 20, 2014

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,

Semyon

Dennis Biringer March 25, 2014

Thanks for you help and explanation.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events