首页 > 解决方案 > SVN 到 git 的转换:分支形成

问题描述

我的 SVN 存储库如下所示:
branches/ tags/ trunk/

在分支文件夹中,我有以下内容:
branches/dev1/example1 branches/dev2/example2 branches/dev3/example3

我想在转换期间制作example1,example2example3作为 git 分支。

git svn clone https://myurl -T trunk -b branches/dev1/example1 -b branches/dev2/example2 -b branches/dev3/example3 -t tags -A authors-transform.txt

我正在进入 linux 中的无限循环。如果我不提供不同分支的选项而只给出-b branches

任何人都可以建议一种在 git 转换期间制作分支的方法吗?

解决方案:

 git svn clone https://myurl -T trunk -b branches/dev1 -b branches/dev2 -b branches/dev3 -t tags -A authors-transform.txt 

标签: gitsvngit-svn

解决方案


你很近!

git svn clone https://myurl -T trunk -b branches -t tags -A authors-transform.txt

Option接受一个目录并将-b那里的每个子目录(dev1,在您的情况下)视为一个分支。您不需要列出所有分支,只需通过.dev2dev3-b branches

-T trunk -b branches -t tags可简写为-sor --stdlayout

git svn clone https://myurl -s -A authors-transform.txt

推荐阅读