Git CVS tutorial

Published: Monday, Jun 30, 2008 Last modified: Saturday, Jul 4, 2020

Say you want to checkout the mobile test suite into a git repository.

The W3C authoritative instructions use Concurrent Versions System. That’s good advice. Lets be crazy and use Git instead.

Lets checkout anonymously first: cvs login

Password is ‘anonymous’.

x61:~/aplix/w3c% git-cvsimport -d 2008/mobile-test
Initialized empty Git repository in /home/hendry/aplix/w3c/.git/
cvs rlog: Logging 2008/mobile-test
cvs rlog: Logging 2008/mobile-test/nored

With my W3C ssh ‘khendry’ login:

export CVS_RSH="ssh"
git-cvsimport -d 2008/mobile-test

For a normal CVS checkout (for git-cvsexportcommit):

cvs -d checkout 2008/mobile-test
cd 2008/mobile-test
export GIT_DIR=/srv/www/wct.localdomain/wct/.git
git-cvsexportcommit -v 1deec9ed09888
cvs commit -F .msg 'cookie.js'

You might experience a “too recent” message if you try update too soon.

x61:/srv/www/wct.localdomain/wct% git-cvsimport -v -d 2008/mobile-test

A quicker push with a CVS checkout at ‘/tmp/w3c/2008/mobile-test’:

x61:/srv/www/wct.localdomain/wct% git-cvsexportcommit -v -c -w /tmp/w3c/2008/mobile-test ffceaad60e690600b2f56fd43755fe7e77da38ed
Applying to CVS commit ffceaad60e690600b2f56fd43755fe7e77da38ed from parent aac2a8aa3074ff7c8d0c0c5fe12c70009b78a974
Checking if patch will apply
Patch applied successfully. Adding new files and directories to CVS
Commit to CVS
Patch title (first comment line): window.onload
  cvs commit -F .msg 'xmlhttprequest.js'
Checking in xmlhttprequest.js;
/sources/public/2008/mobile-test/xmlhttprequest.js,v  <--  xmlhttprequest.js
new revision: 1.3; previous revision: 1.2
cvs-debian-1.12.13 update: Updating 2008/mobile-test
cvs-debian-1.12.13 update: Updating 2008/mobile-test/nored
Committed successfully to CVS

And finally check W3C mobile-test CVSweb if everything looks good.

I’m still not entirely sure how git merges back via git-cvsimport. Also unsure how this reflects in the remote gitweb view of my local wct git repository.

Just for my reference, just with CVS: cvs co 2008/mobile-test