2

I'd like to replace my svn repository with git. Unfortunately I can't do this in one shot and to cut a long story short, I need to move an svn repository, with history, into a subdirectory of a pre-existing git repository. So I currently have:

svn:
svn1/
svn2/

git:
git1/
  .git/
  gita/

And I want:

svn:
svn1/

git:
git1/
  .git/
  gita/
  svn2/

Any ideas on the best way to do this?

user336307
  • 393
  • 1
  • 3
  • 4

2 Answers2

0

You can clone the svn repo with git-svn to preserve history and then merge it with the git repo.

For example:

git svn clone path_to_svn_repo

This will create a new git clone of the svn repo. Now go to the directory with your git repo and merge the just-cloned as a normal git repo:

cd git-repo
git pull path_to_converted_git_repo
Michał Trybus
  • 11,526
  • 3
  • 30
  • 42
  • This seemed to work. I did something along the lines of the following:
    git-svn clone svn2
    git mv svn2dirs svn2/svn2dirs
    
    in a separate area:
    git clone git1
    git branch svn
    git checkout svn
    git pull svn2
    git checkout master
    git merge svn
    git push
    
    – user336307 Jul 02 '10 at 13:50
0

Once you have two git repo, you can try link them together through grafts techniques.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250