tags:

views:

79

answers:

2

I've a project developed with GIT and have a few hundred commits. I only have one master branch and the commits are linear.

Now I'm asked to put the source into an existing SVN and ultimately I'd like to preserve the master commit history (the messages and the diffs, author is preset by SVN access).

It's like I need to replay the whole commit history into SVN. Is there a way from GIT to do this more or less automatic?

One idea came to my mind, but I've no clue how to approach it: I create a new empty trunk/ in SVN, clone it with GIT (i.e. an empty GIT SVN clone) and replay my master changes into it and than dcommit it.

In the future I'll do further work with my GIT branch and synchronize it with SVN.

A: 
  1. Set up empty SVN project with some commit.
  2. "git svn clone" it.
  3. Import history in that almost-empty git-svn project (rebase here)
  4. "git svn dcommit".

Issues:

  1. timestamps are broken, author names are broken.
  2. "git svn dcommit" works not so good when there are too much commits to dcommit. Splitting to packs of about 20 commits each is preferred.
Vi
+3  A: 

Google has a very detailed tutorial on how to do this here. It is for importing to Google code, but will work for any svn repo.

Gabe Moothart
Worked like a charm, thanks!
mark