I decided to move all my code from svn to git after I started using GIT with github.com last week. However github plan to charge for private repositories soon so I decided to migrate from github to my slicehost server for private repositories and use github for any public repositories.

This post assumes you already have git installed on you local machine

First of all you will need to install git

apt-get install git-core

Then get you public key and add it to the authorised keys for your github account

cat ~/.ssh/id_rsa.pub 

Now clone your repository to your server

git clone git@github.com:GITHUB-USER/REPOSITRY.git /git/REPOSITRY.git

Now clone to you local machine, im using ssh for this as I have the keys setup

git clone git+ssh://USER@YOUR-SERVER.COM/git/REPOSITRY.git REPOSITRY

That should be it, you will now be able to push to your server instead of git hub.

git push origin master

To make commit messages a little easier you can set a git editor, edit this file

mate ~/.bash_login

and add this line

export GIT_EDITOR="mate -w"
lastest photos
photo John Lennon John Lennon John Lennon Louvre, Paris Paris Paris Eiffel Tower, Paris Eiffel Tower, Paris Paris King's Cross St Pancras Pete Doherty
flickr