Migrate SVN to GIT

When it comes to migrating source code from subversion to GIT people often fear losing their commit history and logs. Luckily, there are a couple of prominent howtos and guidelines all over the web showing that it is in fact quite easy to manage this migration. One of the best guides I’ve found to far is by Jon Maddox. In his post Cleanly Migrate Your Subversion Repository To a GIT Repository he describes the basic steps required in this process.

Basically, all you need to do is to determine all SVN users from to source repository to be migrated and let git-svn do its magic. Fortunately, in case you don’t remember all users the command to migrate SVN code to GIT git-svn fetch will automatically stop once it determines an unknown user. In this case, simple add this user to a plain text file for GIT to be able to map SVN to its internal users and restart the process. Be sure to direct GIT to use this user list (git config svn.authorsfile users.txt).

Errors during migration

In a recent migration process based on gitolite/gitosis I encountered to following error:

could not symlink /srv/git/.gitolite/hooks/common/gitolite-hooked to
./gitosis-admin.git/hooks 

This problem was caused by gitolite’s internal scripts failing to create a mandatory symlink (as the error message suggests). In this case to solution was to let gitolite create an empty repository and manually copy the previously created repository into it. Be sure to check for correct file permissions, since everything must be owned by gitolite to work.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.