kelloti
kelloti

Reputation: 8951

Using Git & SVN with Git being the central server

My company uses Git for version control but we are working on a project with another company that uses SVN (they refuse to use Git). I need to set up our Git server as the central server and somehow provide SVN access to it. I know git-svn works great for using Git while SVN is the central server, but how do I provide SVN access to a Git repository?

Note: I saw that Github is now providing SVN access to their Git repositories. Does anyone know how they do it?

Upvotes: 2

Views: 662

Answers (3)

Dmitry Pavlenko
Dmitry Pavlenko

Reputation: 8968

Yes, you can use SubGit:

Create empty SVN repository

$ svnadmin create path/for/svn/repository

Configure it to link with your Git repository using SubGit:

$ subgit configure path/for/svn/repository
$ #edit path/for/svn/repository/conf/subgit.conf to set git.default.repository (absolute or relative path to your bare Git repository)

Start continuous synchronization:

$ subgit install path/for/svn/repository

Both SVN and Git interfaces will be readable and writable as result.

GitHub uses another approach, as I know: they implemented an SVN interface that accesses the Git on-the-fly. The approach has its own advantages and drawbacks.

Upvotes: 2

kelloti
kelloti

Reputation: 8951

Ok, I'm going to answer my own question with a bad, but feasible, answer (imo). I can use standard patch files to send changes between our two companies. My manager believes this is an acceptable solution, but I really don't like it


EDIT: In response to Noufal Ibrahim, I think that by using Tailor in combination with hook scripts I might actually have an automated solution that might actually work. This blog has a great description for using Tailor to set up an SVN mirror.

Upvotes: 0

Noufal Ibrahim
Noufal Ibrahim

Reputation: 72755

A crude way I can think of is to setup an svn repository inside your network, checkout from there using git-svn, add your real git repo` as a remote, pull from there and push into the svn remote. I don't know if it'll work or is reliable but it should produce some kind of a mirror. You can your side of it in sync using some of the hooks that get kicked in when a push occurs to update the SVN mirror. As for the other way around (when your clients commit to the SVN repository), you'll have to think of something else for that.

Upvotes: 3

Related Questions