SVN到Git的迁移-使用一个主干与多个项目



我有一个SVN存储库,其结构如下,我对20多个项目中的7个感兴趣。

  • 分支
    • 项目1
    • 项目2
    • 项目3
    • 项目4
    • 项目
  • 发布
    • 项目1
    • 项目3
    • 项目
  • 标记
    • 项目1
    • 项目2
    • 项目3
    • 项目4
    • 项目5
    • 项目6
    • 项目7
    • 项目
  • Trunk
    • 项目1
    • 项目2
    • 项目3
    • 项目4
    • 项目5
    • 项目6
    • 项目7
    • 项目

我试着遵循Bitbucket的迁移指南,并在其他帖子中添加了一些内容。无论我尝试以下哪种命令,最终都会得到一个空的.git存储库。

如何使用git-svn只将一个项目放入git存储库?

尝试过的命令

git svn clone –std-layout –authors-file=authors.txt http://{companyURL}/{teamName}/trunk/Project4 Project4

git svn clone –trunk=/trunk –branches=/branches –tags=/tags –authors-file=authors.txt http://{companyURL}/{teamName}/trunk/Project4 Project4

git svn clone –trunk=/trunk –branches=/branches –tags=/tags –authors-file=authors.txt http://{companyURL}/{teamName}/trunk/Project4 Project4 --no-minimize-url

git svn clone –trunk=/trunk/NemloginIntegration –branches=/branches/NemloginIntegration –tags=/tags/NemloginIntegration –authors-file=authors.txt http://{companyURL}/{teamName}/trunk/Project4 Project4

我最终完成了Dan Santos的这篇指南:将subversion迁移到git

使用上述场景的示例:

git svn clone --prefix="" --trunk=/trunk/project4/ --branches=/branches/project4 --tags=/tags/project4 --authors-file=authors.txt http://{companyURL}/{teamName} Project4AsGit --no-minimize-url

这里不同的部分是,我用于Repo的URL仍然在父级,只有分支、标签和主干被钻到正确的位置--没有最小化url是为了确保git不会离开这些深入的url。

丹提到的下一件事是使用"前缀="&’,因为这将使下面的clean git命令按预期工作。我确实尝试过,但最终没有SVN标签变成git标签。

java -Dfile.encoding=utf-8 -jar svn-migration-scripts.jar clean-git

最新更新