Migrate from google code to github or bitbucket

Google code disappears

Repent, the end is near. Google has just announced that they are shutting down google code project hosting. In the email of the announcement they make some suggestions to find a new house for your code such as bitbucket or github. I hope that they have been warned in order to be ready for a massive repository creation from the upcoming exodus of coder refugees.

At the time of writing this, there is a button to automate the migration only to github but it is NOT working due to the high amount of traffic and workload that they are experiencing.

But you can still move your stuff manually. Here are some easy-to-follow steps to move your code from google to github just using your command line.

0 .Go to google code

It is not as obvious as it may seem. Once you log in google is impossible to find a simple link to see your projects. Google is not specially good at usability, but hey, when your shares are valued at >500$ who gives a fuck. Nevermind, go to https://code.google.com/hosting/ and check My favorites

1. Checkout project

Enter into the project you want to migrate and select Source. Copy the command to checkout your code, with read-only is enough.

For example for: http://code.google.com/p/erps-2dam-4vientos/

Go to source and:

svn checkout http://erps-2dam-4vientos.googlecode.com/svn/trunk/ erps-2dam-4vientos-read-only

2. Do some cleaning

Enter the directory and erase all svn files

find . -type d -name .svn -exec rm -rf {} +

Remove any other unnecessary stuff, binaries, jars,.. and the like.

3. Create repo on github or bitbucket

They both have free repository services, sign up and you can create repos.

4. Clone the repo

Once your repo is created they will provide you with a clone url or even the exact command you need to clone the repo locally.

git clone http://clone...

5. Copy files to your local git project directory

Move/copy files from your google-code local copy to git local copy.

mv google-code-dir/* git-project-dir/

6. Add and commit code

Now it's time to add to git the newly copied code files. You can achieve this with to easy commands, Bob Marley style:

git add *
git commit -m 'Exodus: Movement of Jah people! Oh-oh-oh, yea-eah!'

7. Push to remote

Final step to have your code online again and safe for [hopefully] [some] years to come. You'll be prompted to enter your username and password.

git push origin master

Greets for you, lucky bitbucket user. Your nice arse is safe at the moment