bits about life, coding and stuff

This is about some real-life experience using git (for developing) and cvs (because you have to). Why? Because git is faster, easier, you are no longer dependent on a server and it’s just cool to leave stone age. I’m so sorry, Charlie
I assume you have a working environment where git, cvs, cvsps is installed. (use cygwin, macports, apt-get, …) If you access your cvs repository over ssh (:ext:), you have to set-up a public key for ssh-agent (git-cvsimport wants to log in without password request, and you’ll love it, too).
If you are like me and connect via ssh, you should add this line to your ~/.bashrc – you’ll need it every time you make a rebase. (Or just export the variable for now)
Next, cd into the directory where you want your git repo.
You can read all git cvsimport-options on the manpage. The initial import may take a while, so get a coffee while it’s working.
Setup some more cvs infos for git. (Type this in the console and it goes straight to .git/config – you can edit there anytime)
Make sure you are in the git root dir and on the master branch.
Work in your git repo. Always use a branch & checkin often. (see: The Git development cycle)
You wanna be nice to Charlie? git cvsexportcommit is your friend. It exports A SINGLE commit back to cvs.
Before you export commits, you need a fresh cvs directory of your project. So find a convenient location and checkout in cvs:
Then tell git where this checkout can be found (use pwd to get the full dir)
Now we prepared everything. Note, as of git 1.5.6 you can combine both your git and your cvs directory with the option -W. Read this for more info.
To export a single commit from git->cvs you can use this:
But you committed often, didn’t you? If you developed your feature in a branch and are about to merge, you can do it this way:
Your branch is now merged and you can delete it with
Need more Information? Stackoverflow has an excellent article!
Update: You can automate this with a script. I put it in /opt/local/bin/gce
Make it executable:
Now you can commit that way:
Related posts: