我尝试将 svn 存储库克隆到 git,但某些分支位于 svn 根目录中,如下所示。
我试过了
$ git clone svn://url/svn-root -T trunk -b branches -b branch1 -b branch2
and
$ git clone svn://url/svn-root -T trunk -b branches -b .
两者都未能克隆branch1
and branch2
正确。请帮忙。
svn-root
├── branch1
├── branch2
├── branches
│ ├── branch3
│ └── branch4
└── trunk
中提到的一个有趣的工具GitMinutes 第 20 集 http://episodes.gitminutes.com/2013/08/gitminutes-20-mick-wever-on-migrating.html, is SubGit http://subgit.com/stash/import/,一个插件Atlassian 藏品 https://www.atlassian.com/software/stash/overview(这不是免费的,但您可以免费试用)。
您可以在“中了解更多有关 SubGit 的信息GitMinutes #22:Alexander Kitaev 关于 SubGit http://episodes.gitminutes.com/2013/09/gitminutes-22-alexander-kitaev-about.html".
它旨在管理非常规的 svn 存储库布局。
德米特里·帕夫连科 https://stackoverflow.com/users/1212681/dmitry-pavlenko comments https://stackoverflow.com/questions/18693377/how-to-clone-a-nonstandard-svn-repo-to-git/18693798#comment27556401_18693798:
您应该在“分支机构”字段中输入:
*:refs/heads/*;branches/*:refs/heads/branches/*
# instead of
branches/*
在这种情况下branch1
将被翻译为refs/heads/branch1
,
branch3
--- to refs/heads/branches/branch3
.
或者,如果您的顶级分支数量有限,您可以显式枚举它们:
branch1:refs/heads/branch1;
branch2:refs/heads/branch2;
branches/*:refs/heads/branches/*
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)