I’m finally writing a post about converting a Subversion repository to Git. I first learned about this from Paul Dowman’s blog.

git svn clone <svn repo url> --no-metadata -A authors.txt -t tags -b branches -T trunk <destination dir name>

Paul suggested doing this for each tag:

prompt> git tag tagname tags/tagname
prompt> git branch -r -d tags/tagname

So I wrote a little command line “one liner” and posted it as a comment to Paul’s blog post. Unfortunately, Wordpress does some smarty pants formatting on it, which makes it fairly useless. Besides, there was a mistake in my “one liner”. This one is the latest version I’m using:

git branch -r | grep tags | sed -r "s/tags\///g" | awk '{ print "git tag "$1" tags/"$1 " && git branch -r -d tags/"$1 }'