[英]Migrate subfolders of SVN repo to git
Is it possible to migrate only a part of a SVN repo to Git? 是否可以仅将SVN存储库的一部分迁移到Git? Note that I have to migrate more than one folder located in the root, but not all of them. 请注意,我必须迁移根目录中的多个文件夹,但不是全部。 For example given the following repo: 例如,给出以下回购:
REPO_ROOT
- FOLDER_A
- FOLDER_B
- FOLDER_C
- FOLDER_D
I want to migrate to the Git repo only FOLDER_B
and FOLDER_C
我只想迁移到Git FOLDER_B
和FOLDER_C
Yes. 是。 You have to clone from URL of your folder and (for Git 1.6.4+) use (except others) option --no-minimize-url
您必须从文件夹的URL克隆,并且(对于Git 1.6.4+)使用(其他除外)选项--no-minimize-url
git svn clone --prefix=svn/ --authors-file=authors.txt --no-minimize-url http://PEPO/PATH/TO/FOLDER/ ...
I found a convenient solution: 我找到了一个方便的解决方案:
git remote add -f tmp_repo PATH_OF_THE_SVN_CONE
键入git remote add -f tmp_repo PATH_OF_THE_SVN_CONE
git merge -s ours –no-commit tmp_repo/master
输入git merge -s ours –no-commit tmp_repo/master
git read-tree –prefix=Demo/Kinect -u Kinect/master
键入git read-tree –prefix=Demo/Kinect -u Kinect/master
git remote remove tmp_repo
键入git remote remove tmp_repo
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.