svn外部包含一个git分支



我有一些遗留项目,这些项目使用了一个位于git上的子模块。

有很多方法和工具可以支持迁移到git和/或从git对svn项目进行子模块化,但我需要的恰恰相反。由于它们是我无法控制的遗留项目,我无法将它们迁移到git。我需要的是,每当我在git上推送到origin/master时,我希望svn项目能够在进行"svn-up"或"svn-co"时自动获取这些更改

有什么办法做到这一点吗?

我尝试过svn:externals,但它们不支持git子模块。。。任何线索都将不胜感激。谢谢

作为一个解决方案,我可以建议将SubGit安装到两个存储库中——它将为SVN存储库创建一个Git接口,为Git创建一个SVN接口。然后,您可以将svn:externals添加到svn接口的主存储库中,并将子模块添加到其(同一主存储库的)Git中,该接口使用您的从属存储库的svn和Git接口。

要为Git存储库安装SubGit,请运行:

$ svnadmin create svn.repository
$ subgit configure svn.repository
$ #edit svn.repository/conf/subgit.conf ('git.default.repository' option) 
to set path to your bare Git repository (the repository you on the server)
$ #optionally prepare svn.repository/conf/authors.txt file
to configure custom authors mapping (if you don't like automatic default mapping)
$ subgit install svn.repository

要将SubGit安装到SVN存储库中,请执行相同的步骤,但使用现有的SVN路径而不是SVN.repository和git.default.repository的不存在路径(将在此路径上创建git存储库)。

SubGit将保持每个存储库的两个接口同步,两个接口都是可写的。

希望,这有帮助。

最新更新