Wednesday, July 7, 2010

Migrating from svn to git

Several tutorials have already documented the necessary steps for the conversion from svn to git (, so I won't reiterate any of that. What made our migration tricky were two things:
  1. SVN commits without authors
  2. No tags, branches, or trunk paths
The second was easy to fix actually. I didn't specify any flags for standard layout or tags/branches in the git svn clone command. The second took a little bit of guess work. Before I begin, I'll point out that I used the script (after cleaning up the leading and trailing white space)

svn -q log | grep ^r | cut -d '|' -f 2 | sort | uniq > authors.txt

as conveniently provided in the comments to one of the tutorials. Just to make life easy, I used the following VI macro to fill out the definitions in the file,

yeA= ^[pa <^[>^[j0

I noticed a blank line in the file, which was generated because of commits to the repo with no user name -- literally just the empty string. Big deal, I just removed it. When I tried to run the "git svn clone" though, it puked when it got to those revisions:

$>git svn clone svn://svn.domain/project -A authors.txt
Author: (no author) not defined in authors.txt file

I googled and found a support article,, which didn't actually solve the problem, just avoided it. It turned out the fix was actually easier than I thought. I added the following line to the authors file:

(no author) = no_author


  1. Just in case some one needs it, in my case I had to add also the email. Something like:
    (no author) = no_author

    1. Big data is a term that describes the large volume of data – both structured and unstructured – that inundates a business on a day-to-day basis. big data projects for students But it’s not the amount of data that’s important.Project Center in Chennai

      Spring Framework has already made serious inroads as an integrated technology stack for building user-facing applications. Corporate TRaining Spring Framework the authors explore the idea of using Java in Big Data platforms.

      Spring Training in Chennai

      The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training

  2. The blog or and best that is extremely useful to keep I can share the ideas of the future as this is really what I was looking for, I am very comfortable and pleased to come here. Thank you very much.

    Digital Marketing Course in Chennai
    Digital Marketing Training in Chennai
    Online Digital Marketing Training
    SEO Training in Chennai