从SVN迁移单个分支到Git

3

我有一个旧的SVN仓库,里面有5个分支,我想将其中一个分支迁移到新的Git仓库。

需要迁移的SVN分支路径为:http://xx.xxx.xx.xx/svn/myRepo/branches/firstBranch

当我运行这个命令时:

git svn clone http://xx.xxx.xx.xx/svn/myRepo --no-metadata --stdlayout  --branches branches/firstBranch --prefix origin/ --trunk .

当我使用Git命令检查完整的代码库时,它会返回所有分支。但是我只需要获取Git存储库中的一个分支。

1个回答

7
你不需要使用 --stdlayout--branches。只需执行 git svn clone http://xx.xxx.xx.xx/svn/myRepo/branches/firstBranch . 即可。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接