0

我有使用驻留在 git 上的子模块的遗留项目。

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

有什么办法可以做到这一点?

我试过 svn:externals 但他们不支持 git submodule ...任何线索将不胜感激。谢谢!

4

1 回答 1

1

As a solution I can propose to install SubGit into both repositories --- it will create a Git interface for SVN repository and SVN interface for Git. Then you can add svn:externals to the main repository for SVN interface and add a submodule to its (the same main repository's) Git, interface using SVN and Git interfaces of your slave repository.

To install SubGit for Git repository run:

$ 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

To install SubGit into SVN repository, perform the same steps, but use existing SVN path instead of svn.repository and non-existing path for git.default.repository (a Git repository will be created at this path).

SubGit will keep in sync both interfaces of every repository, both interfaces are writable.

Hope, this helps.

于 2012-07-26T09:42:38.673 回答