tags:

views:

37

answers:

1

I'm trying to migrating a svn repository to another git repository. I read all the documents as well. But they are talking about how to migrate a svn repository to a NEW git repostory. What I want to do is let the svn repository as a part of the old git repository with the svn log.

I have a git repository and a svn repository

Files in git directory:

drwxr-xr-x 2 root root 4096 2010-02-26 00:58 a
drwxr-xr-x 8 root root 4096 2010-02-24 14:46 .git

SVN repository(after run git svn clone):

drwxr-xr-x 2 root root 4096 2010-02-26 00:58 b
-rw-r--r-- 1 root root    0 2010-02-26 01:00 readme.txt
drwxr-xr-x 8 root root 4096 2010-02-24 14:46 .git

As you see, I got two .git directories. That means I got two different git repositories. I just want them to be one like this:

Files git directory:

drwxr-xr-x 2 root root 4096 2010-02-26 00:58 a
drwxr-xr-x 2 root root 4096 2010-02-26 00:58 b
-rw-r--r-- 1 root root    0 2010-02-26 01:00 readme.txt
drwxr-xr-x 8 root root 4096 2010-02-24 14:46 .git

git svn clone will create a new git repository. Is there any way to migrate the two git repository as one?(Do NOT miss svn and git logs)

A: 

After running git-svn clone (let's call this repository S), go to your other git repository and add a remote to repository S and fetch it.

To merge both histories there are several options depending on your situation:

  • Just merge them (git merge)
  • Use grafts and filter-branch
  • Rebase
Mauricio Scheffer