Skip to content

February 28, 2012

Exporting a subversion repository from a git repository using github

Ok, so, you want to quick-and-easily export your git repository as a subversion repository, the answer is pretty straightforward: Use github as an intermediary.
For it, you first will need to configure a github account and create a repository, that’s not the object of this article so you might want to dig up a little over the google seas. For this example, repository FooBar will be used, and repo.foobar.com will be the origin git.

First, we go to our own repo’s directory (a clone of your current repository’s), and add github proyect as remote, like this:

1 2 3 4
git clone git@repo.foobar.com/FooBar
cd FooBar
git remote add github git@github.com:XayOn/FooBar
# Remember to replace XayOn for your username and FooBar for your github repo name
view raw gistfile1.sh This Gist brought to you by GitHub.

Luckily, github exports automatically all its git repos as subversion, so, right now, you’re already able to execute:

svn co http://github.com/XayOn/FooBar

And there you have it, your git repo, exported as subversion, just keep the github repo updated with

git remote push github <branch>

																				

Share your thoughts, post a comment.

(required)
(required)

Note: HTML is allowed. Your email address will never be published.

Subscribe to comments