How to copy a Git repository to an empty SVN repo server?

I installed an empty svn on the server, and I worked on local commits along the way. Now I want to transfer my repo to the svn server. For this, I tried:

git-svn checkout http://remote.svn.server.com git-svn dcommit 

Git complains that:

 Use of uninitialized value in concatenation (.) or string at /usr/bin/git-svn line 411. Committing to ... Unable to determine upstream SVN information from HEAD history 

Since I first started on my local computer, and the online repo is empty, I cannot find information on how to make this work.

+12
git-svn
Jan 19 '09 at 14:15
source share
2 answers

Here is what I would do:

 git-svn clone http://remote.svn.server.com otherdir 

Then in another directory upload changes locally from your previous directory. Then you should have a git repo that is “connected” through git-svn, and you should be able to use dcommit on it.

It may also be useful to read.

+6
Jan 20 '09 at 0:21
source share

I need something like this recently and the process is relatively simple.

Brandon Dimchef's good tutorial, “Commit a linear git story for subversion” (replaces an old broken link ) on which these steps are based.

Starting with git version 1.6.3, these are the following steps:

 $ svnadmin create svn_repository $ svn mkdir -m "Initial setup" file:///full/path/to/svn_repository/trunk $ mkdir gitrepo && cd gitrepo $ git init $ echo 'Hello from Git' > file.txt $ git add file.txt $ git commit -m "Hello from Git" $ git svn init --trunk=trunk file:///full/path/to/svn_repository/ $ git svn fetch $ git branch -a # Lists remotes/trunk $ git rebase --onto remotes/trunk --root master # => Applying: Hello from Git etc. $ git svn dcommit # => Committing to ... Committed r2 ... etc 

Now you can do svn checkout svn_repository and look at the git repository.

+28
Jun 11 '09 at 15:18
source share



All Articles