migrate svn to subdirectory of git

亡梦爱人 提交于 2019-12-07 22:32:21

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!