It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

SVN to Stash sync - issues with remote branches/tags

Jon Sword Jun 23, 2013


I am working on migrating some projects from SVN to Stash using git-svn.

I can successfully copy my content from svn to git using the following instructions:

However, when I push from git to Stash using these instructions:

the branches/tags do not appear. It looks like either only local branches/tags get pushed to Stash or only local branches/tags appear in Stash (not sure which...).

The git documentation here:

explains how to convert remote tags/branches to local during a migration to git and doing this makes the new local branches/tags appear in Stash, however doing this breaks the sync.

My current process looks like this:

git svn clone --trunk=/trunk --branches=/branches --tags=/tags --ignore-paths="xxx|yyyy" --revision 63615:HEAD --authors-file=/opt/account/authors.txt file:///opt/account/SVNData/repository_backups/CODE/CODE3 code3.git
git remote add stash http://user@stash-dev/scm/code/code3.git git for-each-ref refs/remotes/tags | cut -d / -f 4- | grep -v @ | while read tagname; do git tag "$tagname" "tags/$tagname"; git branch -r -d "tags/$tagname"; done git for-each-ref refs/remotes | cut -d / -f 3- | grep -v @ | while read branchname; do git branch "$branchname" "refs/remotes/$branchname"; git branch -r -d "$branchname"; done git push --all stash git push --tags stash


cd code3.git
git svn fetch
java -jar /opt/account/svn-migration-scripts.jar sync-rebase

This seems like something that others would have encountered. Any thoughts on what I am doing wrong?

1 answer

1 accepted

1 vote
Answer accepted
Charles O'Farrell Jun 23, 2013

Hi Jon,

The problem will most likely be with the conversion of tags/branches. The 'git push --all' should push all of your converted SVN branches to Stash, which should then be displayed as normal.

After running your own process (before the pushes) can you see the converted branches when you run 'git branch'? If not what can you see if you run 'git branch -a'? If that returns all your branches from SVN (ie refs/remotes/branch_name) then you may want to try following the 'Clean Up' step of our go-dvcs site, which is similar to the two for-each-ref commands above.



Jon Sword Jul 01, 2013

Hi Charles,

I was unable to see the branches without the '-a' however using the "Clean Up" commands on the go-dvcs page resolve the issue.

Thanks for your help!

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published 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 R...

1,998 views 1 19
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you