Home > Uncategorized, Work > All I needed to know about CVS

All I needed to know about CVS

I have just rediscovered some notes I made while I was carrying out a Release Management role last year, where I had to use CVS as our repository. I’m hoping that if ever I have to perform a similar role again, the SCM tool will be a more modern and capable one.

However, CVS is still quite widely used as a legacy application. Just in case my path meets CVS again, I made a note of the commands which, in practice, were the only ones I found I needed to know on a regular basis. I’m sharing them below in case anyone else finds CVS in use on a project and needs a crash course in the basics.

For basic file level operations I used the WinCVS tool most of the time, but sometimes it was easier to log onto the UNIX box and run commands from the command line.

To commit all changed files in the current directory (and any subdirectories):
cvs commit –m ‘log message

To tag a release, starting at the top of the directory structure will tag everything beneath. Can also just tag a folder or a file.
cvs tag tagname

If I accidentally tagged a newer version of a file, it is easier to delete the tag on that file and retag to the correct version.
To delete a tag on a file:
cvs tag -d tagname filename

Having deleted a tag, revert it to a previous version of the file (alternatively, rev can be a tag)
cvs tag –r rev tagname filename
cvs tag –r 1.7 TEST-5-12 foo.txt

To correct a log message:
cvs admin -m revision:message files
cvs admin –m 1.2:“Corrected message” fatfingers.txt

How to find out what’s changed between two tags (including HEAD):
cvs diff -N -c -r tag1 -r tag2 | grep "Index:" > changed_files.txt

Anything else I needed to do was a complete one-off, and I looked up as and when needed from an online manual.

A couple of links to online manuals:
Version 1.11.22

  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: