Docunext


Converting Subversion to Git

June 11th, 2010

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 }'
Yearly Indexes: 2003 2004 2006 2007 2008 2009 2010 2011 2012 2013 2015 2019 2020 2022