git 用于从包含多个重复存储库的 SVN 迁移的 svn 工具

git svn tool to migrate from SVN containing multiple duplicate repositories

我正在开发一个项目,其中 SVN 存储库包含重复的存储库

/trunk/project_v1
/trunk/project_v2
/trunk/project_tomcat_migration_v3
/trunk/empService1
/trunk/empService2
/trunk/empService_random_string_v3

  .
  .

Tags 还包含重复的存储库。

  1. 我想选择最新版本的项目 svn 存储库(比如 project_tomcat_migration_v3)并将其推送到 master 上的 git 存储库。其余的重复存储库(比如 v1 和 v2),我想推到一个单独的分支上。有什么方法可以使用 git svn 命令来实现这一点。
  2. 如果 git svn 无法实现上述目标,是否有任何方法可以克隆 SVN 存储库并将其复制到现有 git 存储库的分支
    如下所示:

git svn clone http://url/trunk//trunk/project_v2 --separate_branch_on_existing_repo

使用 svn2git。您可以使用路径指定哪个 repo。

https://github.com/svn-all-fast-export/svn2git

create repository project_v1
end repository

create repository project_v2
end repository

match /trunk/project_v1/
repository project_v1
branch master
end match

match /trunk/project_v2/
repository project_v2
branch master
end match

注意:标签是SVN中的分支,必须声明稍有不同。 ([^/]+)/用于匹配标签名。

match /tags/project_v1/([^/]+)/
repository project_v1
branch refs/tags/
annotated=true
end match