Here’s the story of how I migrate my old code under CVS repository to GitHub.
Is this a impossible quest ?!
I was a young geek, I own my CVS server where I used to commit my projects (code, configuration file and so on).
Today, as a old geek, I decide to migrate those repositories to GitHub (discovered few month ago)…
So, when I decide to do this, I try to find some information about « how do the f*** I do that ?! »… after a simple « migrate cvs to git » google search, I began to read some interesting URL as:
- Git SCM documentation about CVS import ;
- Some « Tips and Tricks » about Git;
…but all those docs doesn’t help me because everything I try fail ! In fact, « git cvsimport » command isn’t the best way for that, what a loss of time…
Then, after hours of search, I finally found THE good blog in which everything works for me.
The process
So, here’s the package needed and how I do.
First, install cvs2svn. Why ? Just because cvs2git is part of this package:
# apt-get install cvs2svn
Then, I just apply the first command but I’ve been warned:
$ cvs2git --blobfile="~/blob.dat" --dumpfile="~/dump.dat" /home/toffe/Documents/Sources/mudaemon
ERROR: Git output requires a default commit username
So, don’t forget « –username » option !… And « –encoding » too, especially if your commit log messages contains latin1 characters (as used here). But there’s another error I met with « –blobfile » and « –dumpfile »: don’t use double-quote for file location, it cause error (just for me, maybe). I also understand that I need my cvs server repository style files (you know, those ‘,v’ files…).
So I finally got to do this:
- Get a backup copy of CVSROOT & CVS files:
scp -r toffe@BACKUPServer.dom.tld:Backups/opt/opt/cvs_repo/mudaemon .
- Execute:
cvs2git --blobfile=blob.dat --dumpfile=dump.dat --username="nah-ko" --encoding="latin1" /home/toffe/Documents/Sources/mudaemon
- Then apply « Step 3 » (create git repo, initialise it and do the fast-import)
- Finally, do a «
git checkout
«
That’s all !!
I don’t give here all those details or results of command because there’s nothing more interesting into it.
After that, I’ve just to create a GitHub repository and give it as remote origin to my local one…
git remote add origin https://github.com/nah-ko/MUDaemon.git
git push -u origin master
And now, all history is available in my GitHub repo: https://github.com/nah-ko/MUDaemon/commits/master/ProcessHandler.py
Really awesome! I’ll migrate my others repo soon !