简体   繁体   English

将带有子模块的Git仓库导入到Subversion仓库

[英]Import Git repository with submodules into a Subversion repository

What is the best approach for importing a Git project with submodules into a Subversion repository? 将带有子模块的Git项目导入Subversion存储库的最佳方法是什么?

Not sure if it matters, but the submodules are pointing to the Kohana core and module repositories on github. 不确定是否重要,但是子模块指向github上的Kohana核心和模块存储库。 It would be nice if I could reference these external repositories in Subversion, but it's definitely not a requirement. 如果我可以在Subversion中引用这些外部存储库,那就太好了,但这绝对不是必需的。

Thanks, Mike 谢谢,迈克

To import git to svn: 要将git导入svn:

  • Create a svn repo, in the standard format that you want imported into. 以您要导入的标准格式创建一个svn存储库。
  • Associate your git repo with the svn one: 将git repo与svn关联:

     git svn clone https://svn.com/new_svn_repo --stdlayout 
  • Checkout the trunck and merge the master 检出trunck并合并母版

     git checkout trunk git merge master 
  • Send the objects to the svn 将对象发送到svn

     git svn dcommit 
  • Done! 做完了!

I don't think there is a simple way to include submodules within this. 我认为没有简单的方法可以在其中包含子模块。 You should probably manually add the svn repos svn externals 您可能应该手动添加svn repos svn externals

I would recommend to import the repository using SubGit . 我建议使用SubGit导入存储库。 Look at this comment for instructions. 查看此评论以获取指示。 Though it doesn't support submodules so far, I know no other tool that does. 尽管到目前为止它不支持子模块,但我不知道其他工具可以支持。 But it fits migration purposes better. 但这更适合迁移目的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM