Using CVS

Contents


Overview

CVS is a file version control system. It is used for group projects where files are shared. It allows you to effortlessly share changes to files. Instead of saying that you changed a specific file in the shared directory and having everyone copy that file, each user simply types one command that automatically updates their own copy of any files that have been modifed in the shared directory. Similarly, you just type one command when you want to check-in your changes, and CVS will check for all the files you have modified. Each time you check in a file, it gets a new version number. You can retrieve any version of any file. So if you start making changes to a file, and they just aren't working out, you can simply get back the last (good) version of the file that was checked in. Basically, this means that you don't have to worry about making a backup of a file once you get part of it to work; just check it in. The key is to check in your files frequently. You can also add a comment each time you check in a file, so this allows you to track the changes to the file; it also records the time and which user checked the file in. You also don't have to worry as much about accidently deleting files, since you can at least get back the last version you checked in.

CVS is useful for the projects in this course. However, it becomes more important as there are more people and more files. For commercial development, it helps track version releases and bug fixes. CVS is just one version control system; there are several others that provide similar functionality, such as RCS (also UNIX).

Setting Up CVS

CVS stores files in a single location called the repository. One member of your group must put the repository on his/her account. Every group member (including the one with the repository directory) has their own working directory.

The following example shows how to set up cvs.

File Header Format

cvs can add logging information to your files that tells who checked in files when, and the comment they entered. An example is:
-- chip.vhd

-- $Log: $
--

library ieee;

Once this has been checked in twice, the header will look like:

-- chip.vhd

-- $Log: chip.vhd,v $
-- Revision 1.2  1998/10/24 17:04:25  psomogyi
-- Made many changes (this should actaully be descriptive).
--
-- Revision 1.1  1998/10/24 17:03:42  psomogyi
-- Initial revision.
--
--

library ieee;
uses ieee.something;

Using CVS

All these commands should be executed from your project directory, unless otherwise noted. You can type 'man cvs' for more information on using cvs in general.


Written by Paul Somogyi. All comments and suggestions are welcome.