Journal marcello_dl's Journal: Quick and dirty subversion to git repository migration
while git-svnimport can be used for proper subversion repositories, I had issues with it and a personal svn repository which didn't follow the traditional svn layout with trunk branches tags (shame on me). Well why not simply iterate over the revisions and importing them? Seems to work. Here's how I did it:
first run
svn info [URL of the svn repository you want to migrate]
to discover how many revisions it has till now.
then let's get the commit messages so we can recycle them:
for i in `seq 1 [number of revisions]`; do svn log -r $i [URL of svn repository] >
then:
svn co --revision 1 [path to the svn repository you want to migrate]
so that a dir with a working copy is created, we'll call it [target git repository]. Now let's migrate all changes:
cd [target git repository]/
git-init
echo *.svn >>
for i in `seq 1 [number of revisions]`; do cd
That should do it. Better do a
git-gc --prune --aggressive
(Do it when nobody else is accessing the new git repository!!!) so that you save space on disk, and a
git clean -d
to get rid of now useless