Pushing a converted svn repository to GIT/Stash


I ran the following command "git svn clone --stdlayout https://denpwsvn1/svn/magnetar magnetar" to convert one of my Subversion repositories to GIT. Now I want to add that to a new bare repository I added in Stash called magnetar that is located at "http://amorin@dentwgit1:7990/scm/MAG/magnetar.git". I am having trouble here and not sure how to do this. I tried cd'ing into the converted repo and running...

git remote add magnetar http://amorin@dentwgit1:7990/scm/MAG/magnetar.git


git push --all magnetar

I get propmted for my password and the recieve the following message.

Password for 'http://amorin@dentwgit1:7990':
No refs in common and none specified; doing nothing.
Perhaps you should specify a branch such as 'master'.
Everything up-to-date

Any idea on what I am missing. Sorry very new to GIT.



3 answers

1 accepted

1 vote
Answer accepted

Hello Andrew,

Have a look at SVN Importer Plugin for Stash, https://marketplace.atlassian.com/plugins/org.tmatesoft.subgit.stash-svn-importer

With this plugin, you can import any SVN repository into Git right from the Stash UI:

  1. Create empty Git repository;
  2. Go to Settings tab, choose 'Import from SVN' ;
  3. Specify URL to SVN repository;
  4. Specify all the branches and tags in SVN repository;
  5. Optionally specify credentials to authorize against SVN server;
  6. Click import button;

The plugin imports revisions from SVN to Git in the background. You can pause and resume the importing process at any time.

The plugin is Free; it's based on SubGit tool. For more details please refer to http://subgit.com/stash/ or contact us at support@subgit.com

Very nice tool. Thanks for the information.

I also followed the "My code is already tracked by GIT" instructions in Stash using...

C:\Subversion\magnetar\magnetar>git remote set-url origin http://amorin@dentwgit1:7990/scm/MAG/magnetar.git

push origin master
Password for 'http://amorin@dentwgit1:7990':
error: src refspec master does not match any.
error: failed to push some refs to 'http://amorin@dentwgit1:7990/scm/MAG/magnetar.git'

and got the message above...

0 votes

Hi Andrew,

error: src refspec master does not match any.

means you don't have a local branch called master.

Just to double check, does the initial Subversion repository you cloned follow the standard Subversion layout and includes trunk, tags and branches subdirectories under https://denpwsvn1/svn/magnetar?

I'm assuiming it does as you've cloned the repository with the --stdlayout flag.

git push --all tries to push all the locla branches in the git repository but

after running the `git svn clone` command, you need to convert all the

Subversion branches to local branches first before you can push them.

The process briefly works like this:

* You do an initial clone (using `git svn clone`)

* You turn the Subversion branches into _local_ git branches

* You turn the Subversion tags (that are just tracked as git branches initially) into git tags

* Now you can push.

If you follow the steps on http://go-dvcs.atlassian.com/display/aod/Clean+Up,

you should be able to push your repository to Stash.

We have a more detailed description about the migration process here (this is talking about moving to Bitbucket but the initial steps apply to Stash as well):


and I've written a post about moving the Confluence team on our blog, explaining the process:


Hope this helps.



Yes I use the stdlayout for that repository. Thanks..I was just reading about that. Thanks for pointing me in the right direction!

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 14, 2019 in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder

...ipe.sh :  #!/bin/bash source "$(dirname "$0")/common.sh" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

266 views 0 12
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