Partial import from SVN to GIT with history and multiple branches

GIT comes with some nice built in functionality for importing into GIT from SVN, but when you break outside the expected, things get a little weird, a little fast.

I have been doing some migrations of some of a code base from SVN to GIT, but in keeping with the GIT best practices, each artifact gets its own repo, unlike SVN, where everything typically lives in one monolithic hierarchy.

This does not work out of the box, using the basic options. You will want to follow the bit about creating a users.txt file, and the parts for converting tags and branches to GIT branches, however for the clone itself, I found this to work better for me:

git svn clone https://your-svn-server/path/to/repo/ -T path/to/sub-tree/that/is/being/imported –authors-file=users.txt –no-metadata

Hope that helps someone, and maybe even me when I need to do it again and cannot remember how…

Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>