How do I re-integrate a svn and git repository without a common history?

Viewed 3359

I have a github-based git repository that represents development up to a certain point, and then a svn repository, not initialized with git svn, that has further development. I want to bring the svn changes into the git repository, start using the git repo for development, and push changes using git svn dcommit. Is this possible? Is it advisable?

Here's my specifics:

We started development on a WordPress plugin here:

http://github.com/mrdoornbos/wpconfidentcaptcha

Master is at ef82b94a1232b44aae3e, and no further changes were made in github.

When our application to wp-plugins.org was accepted, an empty svn repo was created for us:

http://svn.wp-plugins.org/wp-confident-captcha/trunk@278927

Somewhat modified files were then copied in (r256425). Further changes were made, the last being r278935.

What I want is for the SVN changes to be applied to master, along with the git svn metadata.

Here's what I have so far (takes about 4 minutes):

git clone git://github.com/mrdoornbos/wpconfidentcaptcha.git github_cc
cd github_cc
git svn init --stdlayout --prefix="svn/" http://svn.wp-plugins.org/wp-confident-captcha
git svn fetch --revision 256362:278935

This puts my github tree in origin/master, and my svn tree in svn/trunk (and all the tags in their own /svn branches as well). There is no common ancestor between origin/master and svn/trunk. I'm not sure where to go from here, or if there is a way to get the changes from svn/trunk onto origin/master, so that the head of the two repos have identical files, and let git svn dcommit work from origin/master.

Starting over with a new github repo seems like the most straightforward way, and I wouldn't be sad about losing the early history. But, it seems like there should be a way to make this work with the existing github repo.

(Edit: it looks like this was already asked as How to merge two branches without a common ancestor?, but without the git filter-branch example needed to make it work. Unlike that question, these are public svn and git repos, so an answer with a working script is possible.)

2 Answers
Related