Moving SVN repositories to Git is obviously inherently a good idea since Git is a far better vcs. I needed to transfer a very large SVN repository to Gitorious and it did take me a while to figure out how to do it. Turned out git-svn is not the best tool for this. I tried and it took almost two days to fetch the svn repository as a git repository.
Then I found the svn2git Ruby script and that did the trick. Here's how:
- Start by installing git-core and git-svn. Obviously you also need a Ruby environment and the gem package.
- Then install svn2git:
gem install svn2git --source http://gemcutter.org
Then you need to create a committers list because svn has user id's whereas git uses email addresses to identify committers:
svn log | grep -E "r[0-9]+ \| [a-z]+ \|" | awk '{print $3}' | sort | uniq > committers.txt
Edit this file so that each user id has a unique email address in the form ofuser_id = User Name <user@email.com>
Then fetch the repository: svn2git svn://server/path/to/repo --authors committers.txt
At this point, create the repository into Gitorious.Finally, push the contents to Gitorious:git push --all git@gitorious.org:project/repo.git
And that's it. Just took me a few tries to get the svn repository converted correctly.
No comments:
Post a Comment