Nov 11, 2010
Migrating sourceforge CVS source repository to github
As many lshell users showed interest in an git repository to facilitate their contribution, I finally took the time to do the migration.
Lshell’s source code was hosted in CVS repository at sf.net. As I wanted to keep all the commits history, I had to properly migrate all the information from CVS to GIT.
There are no tricky parts here. But I thought it could be useful to have an post describing a whole migration from a sourceforge.net CVS repository to github.
Note that, this process should be applicable to any git repository.
So here it is.
Import your CVS repository using rsync(1):
cd ~/src rsync -av rsync://lshell.cvs.sourceforge.net/cvsroot/lshell/ lshell
This will create an lshell directory containing all your CVS’s information.
Next, setup your git preferences:
git config --global user.name "Ignace Mouzannar (ghantoos)" git config --global user.email "ghantoos@ghantoos.org"
Then, import your CVSROOT to a local git repo:
mkdir ~/src/lshell.git cd ~/src/lshell.git/ git cvsimport -p x -v -d /home/ghantoos/src/lshell lshell
You can now set the origin of your repository in order to synchronize it with your github project later:
Note: you must, of course, create the github project first!
git remote add origin git@github.com:ghantoos/lshell.git
If you get the following error:
fatal: remote origin already exists.
You can reset it this way:
git remote rm origin git remote add origin git@github.com:ghantoos/lshell.git
You should now be ready to push your local repository to github.
$ git push origin master (...) Fetching CHANGES v 1.59 Update CHANGES: 9567 bytes Fetching lshellmodule/lshell.py v 1.73 Update lshellmodule/lshell.py: 52553 bytes Tree ID d08bca08832a3cf3e73fbc3c678d4d606e5402f8 Parent ID 11e0a548c82d4c098ee80cf53764f135f47fb12a Committed patch 193 (origin +0000 2010-10-13 19:52:05) Commit ID e2f7f27a97d923e6bab1fb4aa37341b2dc00c787 Fetching CHANGES v 1.60 Update CHANGES: 9633 bytes Fetching README v 1.26 Update README: 8496 bytes Fetching lshellmodule/lshell.py v 1.74 Update lshellmodule/lshell.py: 52553 bytes Tree ID ecfbe05d5b21114ac8dea28185b95cfde284ac62 Parent ID e2f7f27a97d923e6bab1fb4aa37341b2dc00c787 Committed patch 194 (origin +0000 2010-10-13 22:40:46) Commit ID 7da40f1eddcc48ebfb15f4bdd0591f5517ab713b Fetching README v 1.27 Update README: 8510 bytes (...) Committed patch 201 (origin +0000 2010-10-26 22:35:28) Commit ID c7231cc95c7a8ae3ef9be0304602ba8ba0818777 Counting objects: 1125, done. Delta compression using up to 8 threads. Compressing objects: 100% (965/965), done. Writing objects: 100% (1125/1125), done. Total 1125 (delta 653), reused 0 (delta 0) DONE; creating master branch
That’s it.
Now lshell’s CVS repository can be shutdown as the main (and only) source repository will be the one present on github.
Cheers,
Ignace M
SF.net also supports Git and you can use it as a mirror. Git has a flexible way maintain remote branches, so setting up both repositories won’t bother.
BTW, here the command I used to convert your CVS repos into Git (don’t have to use rsync to make a local copy of CVS repository.)
git cvsimport -v -d :pserver:anonymous@lshell.cvs.sourceforge.net:/cvsroot/lshell -o master -C lshell lshell
Ooh, nice! Thank you Anh for the tip. :)
I’ll try to set up the mirroring between sf.net and github.
Cheers,
Ignace M
Thank you for this post! I didn’t realize you could rsync the cvs repo from sourceforge. This GREATLY sped up importing a 580MB repo compared to importing it via CVS protocol.
@Jevin
I’m glad it helped you out. :)
cheers,
Ignace M