Convert Your code.google.com Project from svn to git

By Xah Lee. Date:

This page shows you how to convert your Google Code svn repository to git.

gitopuss
gitopuss. github mascot.

Goto your Google Code page, choose the menu [Administer] tab, and then choose the menu [Source] tab, then change the repository type to Git.

Then, do the following in terminal on your local machine:

git svn clone --stdlayout https://‹projectname›.googlecode.com/svn ‹projectname›
cd ‹projectname›
git remote add googlecode https://code.google.com/p/‹projectname›
git push --all googlecode

For a project of 1.6k files, it takes about ten minutes.

If you have wiki on Google code, same steps:

git clone https://code.google.com/p/‹projectname›.wiki
cd ‹projectname›.wiki
svn export --force http://‹projectname›.googlecode.com/svn/wiki .
git add .
git commit -m "Initial import of wiki."
git push origin master
The subversion repository will remain accessible at https://projectname.googlecode.com/svn/ , however, they won't be updated.

I did this for my ErgoEmacs project http://code.google.com/p/ergoemacs/. It went smooth. All commit history are also transferred.

Reference: