0

I have legacy projects that is using a submodule which resides on git.

There are a lot of ways and tools that supports migrating to git and/or submoduling a svn project from git, but what I need is exactly the opposite. Since they are legacy projects beyond my control, I cannot migrate them to git. What I need is just whenever I push to origin/master on the git, I'd like the svn-projects to be able to grab that changes automatically whenever they do "svn up" or "svn co"

Is there any way to achieve this?

I have tried svn:externals but they dont support git submodule... any clues will be appreciated. Thanks!

2
  • Is that submodule under your control? I mean, do you have administrator access to the server where it is hosted? Commented Jul 25, 2012 at 8:15
  • yes, I have admin access to both the git and svn repo Commented Jul 26, 2012 at 9:20

1 Answer 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.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks! looks like a nice migration options as it allows both svn and git to co-exist and linked together. Will surely give it a try later!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.