Pedro Rodrigues

home github

Updating old git repositories from svn

This is how I got an old Github repository of WordPress to come up-to-date with the SVN upstream.

I wanted to have a git based repository of WordPress but the most recent one I found in Github was skynet’s one. This repo had been last updated to r11948 in September 2009 so I had to either

The first was out of question has it is both unnecessary and useless, it would also take a shit load of time to complete. The second was something I did not want to resort to has I wanted to keep my repository connected to skynet and it’s other forks inside github. I had to try to clone from github and then somehow connect to the wordpress svn repo.

I have been fiddling around with this for the last few days and has I expected in the end it was quite simple to do. First I forked skynet repository to create one of my own and keep the relation inside of github. This is somewhat unnecessary has I could have just cloned skynet repo directly but i wanted to keep the github network connection. With the github repo forked I cloned the svn repo from from the point in which it was left by skynet. For this I looked into the information of the last update and took the revision number 11948.

> git svn clone []( wordpress -r 11949

This will tell git to clone the svn repository starting after the last revision. Now the repo needs to be brought up to date.

> cd wordpress
> git svn rebase

This will get all revisions past the current HEAD and rebase all changes Then I added my github repository to the local configuration.

> git remote add github And pushed to github
> git push github I also cleaned up, has svn tends to be quite messy.
> git gc

And now I have fresh WordPress repository in github Thanks in part to fnokd.

Read or