SVN Branch to Git master

Hi, I would like to migrate from SVN branch to Git master using SVN mirror. Is is possible to add Subversion URL to SVN Branch and the migration will result in Git master? There are other fields like trunk, branches and tags but in this case all of them will be ommited? (like in this image https://marketplace-cdn.atlassian.com/files/images/org.tmatesoft.subgit.stash-svn-importer/7d2b032f-cc3d-43f9-aac1-01b570e7ae2d_high.png) Is it possible to process migration in this way?

1 answer

1 accepted

Hi Pawel,

SVN Mirror Add-on 2.0.x requires one to specify all those options: trunk, branches, shelves and tags. However, there's a trick you can use in order to import one single branch:

Specify SVN repository root as 'Subversion URL', interesting branch as 'Trunk' and some non-existing directories as 'Branches' and 'Tags':

Subversion URL: <SVN_REPO_ROOT>

Trunk: branches/foo:refs/heads/master

Branches: git_branches/*:refs/svn_heads/*

Shelves: shelves/*:refs/shelves/*

Tags: git_tags/*:refs/svn_tags/*

Since your Subversion repository doesn't have 'git_branches' and 'git_tags' directories, the plugin imports nothing but 'branches/foo' branch from Subversion repository.

If you'd like to use SVN Mirror to synchronize your Git commits with Subversion repository, I'd recommend you keeping Git history linear, otherwise the plugin sends unknown Git branches to 'shelves/*' directory in SVN repository.

Hope this helps,

Semyon

Suggest an answer

Log in or Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

714 views 0 4
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot