Import local subversion repository to git

If you want to import a local subversion repository (maybe a dump) to git you can do this quite easily:

First you need to map the Subversion commit authors to Git commiters. For you just create a textfile author-mapping.txt:

svnauthorname=gitauthorname 

And then you run the following commands:

mkdir repo && cd repo
git svn init file:///path/svnrepo --no-metadata
git config svn.authorsfile ~/author-mapping.txt
git svn fetch

Sometimes the protocol file:// cannot be handled. In that case you can run svnserve –daemon to serve your subversion repository locally. Then you can use svn://localhost/svnrepo instead.

Leave a comment

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