问题
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?
回答1:
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
回答2:
Once you have two git repo, you can try link them together through grafts techniques.
来源:https://stackoverflow.com/questions/3159282/migrate-svn-to-subdirectory-of-git