从 SVN 迁移到 GitHub

Migration from SVN to GitHub

我正在使用 git-svn 从 SVN 迁移到 GitHub。以下是 SVN 存储库中文件的结构,我们称之为 projects_repo

Projects_Repo/

- BranchQA_Test/ 

 - project1/
 - project2/
 - project3/
 - project4/

- tags/ 

 - project1/
 - project2/

- trunk/ 

 - project1/
 - project2/
 - project3/
 - project4/
 - project5/

我想将 ONLY trunk(master) 迁移到 GitHub,每个项目在 [=] 上成为一个独立的 repo 38=]、 历史和没有 标签。

所以 GitHub 看起来像:

- project1/
- project2/
- project3/
- project4/
- project5/

我应该如何自定义 git-svn 命令? 现在我正在使用以下内容:

git svn clone http://url/svn/projects_repo/ 
    --username $username 
    --authors-file=authors_modified.txt 
    --trunk=trunk/project1/   
    --no-metadata -s project1 `

由于迁移比较耗时,所以想提前确认一下。有谁知道这是否是正确的方法?非常感谢。

正如评论中所说:如果您使用 --{trunk,branches,tags} 中的任何一个 - 请务必省略 -s/--stdlayout。尽管文档说 --stdlayout 的优先级较低——安全总比后悔好。因为 git-svn 导入确实需要很多时间。

man 1 git-svn:

-T<trunk_subdir> --trunk=<trunk_subdir>
-t<tags_subdir> --tags=<tags_subdir>
-b<branches_subdir> --branches=<branches_subdir>
-s --stdlayout
These are optional command-line options for init. Each of these flags can point
to a relative repository path (--tags=project/tags)
or a full url (--tags=https://foo.org/project/tags).
You can specify more than one --tags and/or --branches options, in case your
Subversion repository places tags or branches under multiple paths.
The option --stdlayout is a shorthand way of setting trunk,tags,branches
as the relative paths, which is the Subversion default.
If any of the other options are given as well, they take precedence.