svn2gitPublic feed posted on Tue, 21 Feb 2012 by Alex
I’m currently moving our old svn repositories to git. There a lots of reason to do this. Performance, Disk Space, SVN sucks, decentralization and some more.
Here is a Video from Linux Tolvads talking about Git. Tech Talk: Linus Torvalds on git
I recommand this svn2git tool! It has a good documentation, easy to understand and work almost out of the box!
I start looking in my local repository from Gentoo. eix showed git2svn from http://gitorious.org/svn2git/svn2git . There was a problem running it from our SVN Repo. He wan’t able to found some URL part. So it was complete useless. I started to google a bit. I found some nice links that explain and have some examples. Our svn contains lots of different repositories, i used this link here as a sample. The Script fits as basic, i adjusted it, so that it fit fine for me. I change it so it can uses SSH to create the Git repositories on a remote Host. Addtional i created a authors file.
stnick = Santa Claus
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
#!/usr/bin/env bashREPOS="project1 project2 project3 project4"URL="https://10.0.4.7:/Musicpictures"REMOTE_IP="10.0.4.5"for repo in$REPOSdoecho"Create local repor"mkdir$repocd$repo echo"Start of svn2git progress"cmd="svn2git $URL/$repo -m --authors ../authors.txt"echo$cmd`$cmd` echo"Prepare remote Host with SSH"ssh email@example.com "mkdir -p /var/git/svn2git/$repo.git && cd /var/git/svn2git/$repo.git && git init --bar"cmd="git remote add origin ssh://firstname.lastname@example.org/var/git/svn2git/$repo.git"echo$cmd`$cmd`cmd="git push --all"echo$cmd`$cmd`cd .. echo"DONE EXPORTING $repo"doneexit
Addtional i change the the verbose and also i add -m for the orgirnal SVN Link, this coaint then also the classic comit ID.
The Main Problem is that not all of the repo are in the default SVN way store, some has no trunk/tags/branches structures. So i have to check that all has been converted in a right way.Sources: http://chrisjean.com/2009/02/21/git-project-description-file-hasnt-been-set/
>(This is an imported feed item. You can read the original item at /blog.akendo.eu/svn2git/">http://blog.akendo.eu/svn2git/)