简体   繁体   中英

migrate svn to subdirectory of git

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?

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

一旦有了两个git repo,就可以尝试通过嫁接技术 将它们链接在一起

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM