Getting started quickly with CVS

Anuradha Ratnaweera

You don't need to be root to do this.

Set the CVSROOT environment variable to point to your CVS repository, and run `cvs init'.

% export CVSROOT=/home/anuradha/cvs
% cvs init
This creates a new cvs repository. This has to be done only once.

Now let's create our source directory ...

% mkdir hello
% cd hello/
... and add a source file ...
% vi hello.c
... and add the whole tree (only one file in this example) to CVS repository for the first time.
% cvs import hello anuradha start
`hello' is the CVS module name (and directory in CVSROOT), anuradha is the `vendor' tag, and start is the `release' tag. Whenever a file is changed, it can be commited into CVS with:

Add a comment about the import when prompted.

% cvs commit
Use `cvs add' to add files to CVS.
% cvs add hello-2.c
Remember to use the flag -kb if you ever add binary files (say, image files). E.g.:
% cvs add -kb hello.gif
Use `rcs2log' command to generate the ChangeLog.

Use `cvs diff' to list difference between the current tree and the repository. `cvs diff -u' is nicer.

See the CVS man page for more details.