Migrating the Bansshee repository from Subversion to GitEdit

Note

The notes on this page were made some time ago. For more up-to-date notes see "Doing a one-off migration from Subversion to Git".

Migration

I’ve previously written about moving from Subversion to Git in "Migrating Subversion repositories to Git". Here are some additional notes I made while migrating the Bansshee Subversion repository to Git. Bansshee is an excellent little project for practising this kind of migration because its history is so shallow (only 3 revisions!) and so it can be performed and reviewed very quickly.

Initial test run

I first performed an initial test run on my local machine running Mac OS X Leopard.

git svnimport -C bansshee.git svn://svn.example.com/bansshee

I used the -C option to explicitly define the desired output directory as I didn’t want the new Git repository to be created in the current directory.

Output

Initialized empty Git repository in /Users/wincent/trabajo/unversioned/bansshee/bansshee.git/.git/
Counting objects: 50, done.
Compressing objects: 100% (39/39), done.
Writing objects: 100% (50/50), done.
Total 50 (delta 10), reused 0 (delta 0)

Results

The import was a success but as the output of git log shows the Subversion author information (plain usernames) didn’t get translated to full email addresses (the convention in the Git world):

$ cd bansshee.git && git log
commit 129f4b5524dc4d6c056f96b9be303c6afab67a1c
Author: wincent <wincent>
Date:   Thu Dec 7 14:54:00 2006 +0000

    Added Ubunutu Dapper support files

commit b78a8aab61f1d519313168592ebac5c2162e8050
Author: wincent <wincent>
Date:   Mon Oct 16 14:29:39 2006 +0000

    General cleanup (documentation fixes, wrapping, Makefile) for release

commit c94d245716a841774ea37eba892596e78199cfc7
Author: wincent <wincent>
Date:   Mon Oct 16 14:11:55 2006 +0000

    Initial import

Second (official import)

So this time I performed the import again, using the -A switch and a table mapping Subversion usernames to full Git username-plus-email records that I had prepared like this:

echo "wincent = Greg Hurrell <greg@hurrell.net>" >> ~/.svn-authors

I also added the -v switch to get verbose output and the -I switch to automatically translate svn:ignore properties to the Git equivalent (although it turns out that this repository didn’t actually have any svn:ignore properties):

$ cd ..
$ rm -rf bansshee.git
$ git svnimport -v -A ~/.svn-authors -I .gitignore -C bansshee.git svn://svn.example.com/bansshee
Initialized empty Git repository in /Users/wincent/trabajo/unversioned/bansshee/bansshee.git/.git/
Processing from 1 to 4 ...
Fetching from 1 to 4 ...
... 1 /trunk/FAQ ...
... 1 /trunk/HISTORY ...
... 1 /trunk/INSTALL ...
... 1 /trunk/LICENSE ...
... 1 /trunk/NOTES ...
... 1 /trunk/README ...
... 1 /trunk/TODO ...
... 1 /trunk/bansshee ...
... 1 /trunk/bansshee.conf ...
... 1 /trunk/support ...
... 1 /trunk/support/README ...
... 1 /trunk/support/RHEL-ES3 ...
... 1 /trunk/support/RHEL-ES3/README ...
... 1 /trunk/support/RHEL-ES3/etc ...
... 1 /trunk/support/RHEL-ES3/etc/log.d ...
... 1 /trunk/support/RHEL-ES3/etc/log.d/conf ...
... 1 /trunk/support/RHEL-ES3/etc/log.d/conf/services ...
... 1 /trunk/support/RHEL-ES3/etc/log.d/conf/services/bansshee.conf ...
... 1 /trunk/support/RHEL-ES3/etc/log.d/scripts ...
... 1 /trunk/support/RHEL-ES3/etc/log.d/scripts/services ...
... 1 /trunk/support/RHEL-ES3/etc/log.d/scripts/services/bansshee ...
... 1 /trunk/support/RHEL-ES3/etc/rc.d ...
... 1 /trunk/support/RHEL-ES3/etc/rc.d/init.d ...
... 1 /trunk/support/RHEL-ES3/etc/rc.d/init.d/bansshee ...
... 1 /trunk/support/debian-sarge ...
... 1 /trunk/support/debian-sarge/README ...
... 1 /trunk/support/debian-sarge/etc ...
... 1 /trunk/support/debian-sarge/etc/bansshee.conf ...
... 1 /trunk/support/debian-sarge/etc/init.d ...
... 1 /trunk/support/debian-sarge/etc/init.d/bansshee ...
Tree ID 881bc6328dd0275af9dfbaeabefd657267ad140d
Committed change 1:/ 2006-10-16 14:11:55)
Commit ID b8d99b1adf6b146230ce91c781057fe0c9c938e8
Writing to refs/heads/origin
DONE: 1 origin b8d99b1adf6b146230ce91c781057fe0c9c938e8
... 2 /trunk/FAQ ...
... 2 /trunk/HISTORY ...
... 2 /trunk/INSTALL ...
... 2 /trunk/LICENSE ...
... 2 /trunk/Makefile ...
... 2 /trunk/NOTES ...
... 2 /trunk/README ...
... 2 /trunk/TODO ...
... 2 /trunk/bansshee ...
... 2 /trunk/bansshee.conf ...
Tree ID df75bc9805042533fe2536959302c0edf71d7aa5
Merge parent branch: b8d99b1adf6b146230ce91c781057fe0c9c938e8
Committed change 2:/ 2006-10-16 14:29:39)
Commit ID f7e8bc705f60df82527b8370b07dc3c131ef8c8e
Writing to refs/heads/origin
DONE: 2 origin f7e8bc705f60df82527b8370b07dc3c131ef8c8e
Created tag '1.0-RELEASE' on '/1.0-RELEASE'
DONE: 3 1.0-RELEASE f7e8bc705f60df82527b8370b07dc3c131ef8c8e
... 4 /trunk/support/ubuntu-dapper ...
... 4 /trunk/support/ubuntu-dapper/etc ...
... 4 /trunk/support/ubuntu-dapper/etc/bansshee.conf ...
... 4 /trunk/support/ubuntu-dapper/etc/init.d ...
... 4 /trunk/support/ubuntu-dapper/etc/init.d/bansshee ...
... 4 /trunk/support/ubuntu-dapper/etc/logwatch ...
... 4 /trunk/support/ubuntu-dapper/etc/logwatch/conf ...
... 4 /trunk/support/ubuntu-dapper/etc/logwatch/conf/services ...
... 4 /trunk/support/ubuntu-dapper/etc/logwatch/conf/services/bansshee.conf ...
... 4 /trunk/support/ubuntu-dapper/etc/logwatch/scripts ...
... 4 /trunk/support/ubuntu-dapper/etc/logwatch/scripts/services ...
... 4 /trunk/support/ubuntu-dapper/etc/logwatch/scripts/services/bansshee ...
Tree ID baf81d6d51afb1cf4a71e4f9ff2d98c5921bc8fd
Committed change 4:/ 2006-12-07 14:54:00)
Merge parent branch: f7e8bc705f60df82527b8370b07dc3c131ef8c8e
Commit ID 8a0de1f40a6a4e239f09e76b36709e3925edfcf3
Writing to refs/heads/origin
DONE: 4 origin 8a0de1f40a6a4e239f09e76b36709e3925edfcf3
Counting objects: 50, done.
Compressing objects: 100% (39/39), done.
Writing objects: 100% (50/50), done.
Total 50 (delta 10), reused 0 (delta 0)
DONE; creating master branch

Publishing the repository on the remote server

Now I had a fully working local repository but I wanted an always-available, public, "authoritative" clone on git.wincent.dev. How this is done, and how to push the content from the local repository out onto the public one is covered in "Setting up a brand new public Git repository".

See also