Import Git SVN cloned repository into existing Git repository

167 views Asked by At

I had a Subversion / SVN repository and because I moved to Git version control, I just used the last stand of the SVN trunk to initialise the new Git repository. So I lost the SVN history in the Git repository.

Later I used: git svn clone SVN_REPO, so that I got the complete SVN history to a Git repository.

Now, I need to import that Git repository / history into my already existing Git repository.

How can I solve this problem?

1

There are 1 answers

0
Mykola Gurov On

Importing history won't be an issue at all - just add your git-svn repo as a remote and fetch. The problem is that at this point you'll get two unrelated history trees.

If you don't have many distinct living branches in your git repo, you might get away with simple rebase, e.g. given sha-initial is your first commit to the git repo and sha-initial-svn is corresponding git-svn revision :

git rebase --onto <sha-initial-svn> <sha-initial>

Will replay the history of your HEAD on top of the svn history.