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

Pushing a converted svn repository to GIT/Stash

Andrew Morin October 28, 2012

Hi,

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

then

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.

Thanks

Andrew

3 answers

1 accepted

1 vote
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.
November 30, 2012

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

Andrew Morin December 3, 2012

Very nice tool. Thanks for the information.

0 votes
Stefan Saasen
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 29, 2012

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):

http://go-dvcs.atlassian.com/display/aod/Migrating+from+Subversion+to+Git+on+Bitbucket

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

http://blogs.atlassian.com/2012/01/moving-confluence-from-subversion-to-git/

Hope this helps.

Cheers,

Stefan

Andrew Morin October 29, 2012

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

0 votes
Andrew Morin October 28, 2012

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

C:\Subversion\magnetar\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...

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events