After feeling the decline of SourceForge for some time now and kind of naturally having nearly all of my repositories on GitHub, I decided to finally move my older repositories. Unfortunately GitHub’s importer does not support CVS. Here’s how I managed it anyway.
This is in no way a beginners guide. You need to know CVS, git and how to install missing packages on your system. I’m doing this on an Ubuntu 14.04 box. Your commands my vary.
That being said, I would like to start with the useful stuff, skipping all my failures so far.
I’ve 3 projects on SF and would like to show it on the example of moving “Look at the stars” – let’s go!
Steps as follows:
- Create the repository lats on GitHub.
- Locally clone the repository.
- Create an initial empty commit like this:
git commit --allow-empty -m 'Initial commit'
- Import the main branch from CVS:
$ git cvsimport -v -d :pserver:[email protected]:/cvsroot/lats lats -o master -k
- The branch is being imported as “vendor”. But I want it to be called by what it is. So I renamed it:
$ git branch -m vendor release-0.6
- Import the other, older branch from CVS:
$ git cvsimport -v -d :pserver:[email protected]:/cvsroot/lats Look_at_the_stars-0.5 -o master -k
- Rename it to something useful:
$ git branch -m TheBlackLion release-0.5
- Push everything to GitHub:
$ git push --all
- Go to the branch settings on GitHub and make the newest the default. You might want to merge into master here instead. But for my very old stuff this is perfectly fine.
- Create a branch for our files:
$ git checkout master $ git branch sf-files $ git checkout sf-files
- Pull them out of SF:
$ rsync -av --rsh="ssh -l theblacklion" [email protected]:/home/frs/project/lats/ .
- Commit and push them:
$ git add . $ git commit -m "Import of SF files." $ git push --set-upstream origin sf-files
- Create a branch for our website:
$ git checkout master $ git branch sf-pages $ git checkout sf-pages
- Pull it out of SF:
$ rsync -av --rsh="ssh -l theblacklion" [email protected]:/home/project-web/lats/ .
- Commit and push it:
$ git add . $ git commit -m "Import of SF homepage." $ git push --set-upstream origin sf-pages
Finally you might want to get the page running on another server for later presentation. I will leave this as an exercise for the reader.
Thank you for reading!
Also published on Medium.