Skip to content

Instantly share code, notes, and snippets.

@tony4d tony4d/svn2github
Created Apr 8, 2011

What would you like to do?
Migrate an svn repository to git and github
# Assume your svn repo is located at svn://
# Assume your git repo will be located at
# First you need to generate a list of all committers in your svn tree.
# Credit David Wheeler
$ svn log --quiet svn:// | grep '^r' | awk '{print $3}' | sort -u
# Next, create a file in your home directory named svn-committers following this format
mojombo = Tom Preston-Werner <>
defunkt = Chris Wanstrath <>
# Finally, do the migration
# Credit Jon Maddox for some of this
$ cd ~ && mkdir myapp-tmp && cd myapp-tmp
$ git svn init svn:// --no-metadata
$ git config svn.authorsfile ~/svn-committers
$ git svn fetch
$ cd ..
$ git clone myapp-tmp myapp
$ cd myapp
$ git remote set-url origin
$ git push origin master

This comment has been minimized.

Copy link

mhelie commented Apr 30, 2012

If, like me, you're trying to do this from a remote server with a large repo, you'll run into timeout problems. You have to do this locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.