I thought I had written this down somewhere, but apparently I didn’t. Here is the perfect guide for transferring a svn repo to a git repo.
And just in case that blog ever goes down, here is the text:
The first thing we need to do is create a users file that maps all your SVN users to your GIT users. Just make a file on your Desktop named ‘users.txt’. Map the users using this format:
jmaddox = Jon Maddox <jon@gmail.com>
bigpappa = Brian Biggs <bigpappa@gmail.com>
Simple. Now here are the commands you’ll run. I’ll explain them below.
mkdir my_blog_tmp
cd my_blog_tmp
git-svn init http://code.yoursite.net/my_blog/trunk/ --no-metadata
git config svn.authorsfile ~/Desktop/users.txt
git-svn fetch
The first two are self explanatory, we’re making a new directory for the temporary repository. The second command initializes the directory as a git-svn hybrid thing and points the origin at your SVN repository. The flag, –no-metadata, tells GIT to leave all the SVN details behind (not the commit log). The fourth command tells GIT to remap all the SVN users to GIT users when it sucks down the source and history. The last command actually does the fetching.
Ok, so now after a few LONG minutes, your source is all there. Do a git log to see that your users have been mapped. Sweet!
Now you just have one last step. You need to clone this repository. Why do we do this? When doing a normal git clone it will take everything we want from the temporary repository, while leaving behind all the SVN cruft that was there to support the git-svn stuff.
git clone my_blog_tmp my_blog