SVN to Git
Photo by Jeffrey Hamilton on Unsplash
How to migrate a subversion repo to Git
I've been using Git now for over two years. Previously, all my source control was handled with subversion (SVN). To be honest, I can't even remember how to use SVN. To be more honest, I cheated and used TortoiseSVN most of the time anyway.
Every so often I want to update an old website, but my repo is in SVN. I don't even have it installed anymore. So what do I do? I quickly convert it to Git.
Most of my important repos are stored on my Unfuddle account. Fortunately, they support both SVN & Git. I recently converted an SVN repo to Git. Here were the steps I took (I'm using Ubuntu).
1mkdir svntemp2cd svntemp3git svn init http://myusername.unfuddle.com/svn/myusername_myrepo/ --no-metadata4git svn fetch
... wait for fetching ...
1cd ..2mkdir newgitrepo3cd newgitrepoÂ4git init5git remote add origin git@myusername.unfuddle.com:myusername/myrepo.git6cp -R ../svntemp/trunk/* .7git add *8git commit -am "initial commit"9git push origin master
And I think we're done here. Now, back to coding!