24 August 2011

git-svn with less pain

How to make a svn clone with git-svn without spending 10 hours

I recently had the mixed experience of cloning the Rosegarden source from its SVN repo with git-svn.

First thing: Do not believe anyone who tells you to just launch:

git svn clone -s REPO-URL 

If somebody tells you to do that, give them a mean glare from me. It will take hours and hundreds of megabytes. I quit after a total of maybe 10 or 11 hours, after maybe a dozen restarts with no end in sight. It had used about 350 megabytes of disk, and it wasn't anywhere near finished downloading.

Second thing: You're going to have to find the latest SVN revision number by hand. At least, I found no way to do it within the git workflow1. You can find it remotely via svn but if you wanted to use svn you wouldn't be doing this.

What worked for me is:

git svn clone -r $REV:HEAD -s $URL $DIR

where $REV is a fairly recent SVN revision number; $URL and $DIR are obvious.

At the risk of making my own post redundant, this Stackflow thread showed me how to do it.


1 I tried just initting the directory with git-svn and launching various informational git-svn commands from in it; none worked.

No comments:

Post a Comment