So you're ready to ride the GIT train eh? But what about all those projects in your subversion repository? Sure you could just use git-svn but what you really want is to cleanly move that repository and all its history to a nice new GIT repository.
Luckily it's not that hard. For this example I'm going to use my_blog as the application name you're porting to a GIT repository. We're basically going to just initialize a new GIT repository, point it at your SVN repository, and suck in your code and history while remapping the users to GIT users. We'll then just clone THAT repository to have a clean GIT repository free of SVN clutter.
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
Boom! You're done. Now you have a super clean GIT repository all ready to use.
Popularity: 65% [?]



About
Mmm, Del.icio.us
What to do in the case that you're pulling from a Google code repository where the 1st commit has no author. When I run git-svn fetch, I get a complaint: Author: (no author) not defined in ~/users.txt file
You could always define 'no author' i guess. see if that solves it.
Nope. I tried: empty string, "no author", "(no author)". None work. Is it possible to skip the initial revision? Or perhaps pull it down w/o the user mapping and define it later?
Any thoughts on migrating with plugins installed through piston? How does one keep the metadata it uses and pass it on to a suitable replacement? What is the best piston alternative for git? I tried braid but that did not work out on that occasion.
I'm not real sure, I dont really use piston. As for an alternative, there is Giston.
Or Braid.
Thanks for the guide, I just split my huge personal subversion repository into separate git repositories. With a little googling I also figure out how to push them to my web-server.
Be sure to check out GitHub for some sweet GIT hosting action
Thanks to you, sir, every Subversion repo I've maintained on my system is now gone and replaced with Git. My deepest appreciation.
@Rob: you can tell git svn fetch to select a set of revisions instead of starting from the first.
Look in the git svn man page.
> -r , --revision
something like -r 2:HEAD could work I'm guessing.
@Rob: (no author) = First Last worked for me.