2

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?

5
  • Github is using an internally-developed SVN-to-Git gateway. They have been silent thus far about releasing the sources; I doubt they will. Commented Dec 17, 2010 at 16:27
  • A little more background: we're using gitolite for the git server. Perhaps someone should petition/help gitolite to produce a solution? Commented Dec 17, 2010 at 18:26
  • 1
    This is clearly not a valid answer, but I would tell them, "Tough #$@!, you're using git for this project." Commented Dec 17, 2010 at 18:48
  • @haydenmuhl - I like it! unfortunately I don't think it'll work Commented Dec 17, 2010 at 19:01
  • Either they are using git, or they don't get the award of contract. Commented Dec 17, 2010 at 20:44

3 Answers 3

3

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.

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

2 Comments

Yes, I have thought of using hooks as a way to sync SVN & git, but it seems incredibly error prone, so I was hoping someone has some experience doing so.
Well, you have a weird problem so... :)
2

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.

1 Comment

That's a great option. I wish it was available 1.5 years ago :(
0

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.

1 Comment

Well, there are quilt and Tailor which might make your life a little easier.

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.