CVS is a drugstore chain. It also short for Concurrent Versions System. CVS stores a set of files and all the mods that have been made to them. It stores the mods as dated, annotated, version-numbered diffs. CVS stores all this in a place known as the repository (aka $CVSROOT), which may be on a local machine or somewhere on the Internet.
Among other things, CVS lets you:
For example, one developer could be adding new features while another developer makes the maintenance changes that are needed before the new features are ready.
When you check out files, CVS does not lock them, as its predecessor RCS
did. Rather it lets users freely check out, modify and commit (check in)
files at will. CVS is smart enough to inteligently merge the changes back
into the baseline -- in most cases. Occasionally, though, there are merges
that it can't handle, as when two users modify the same line of the same
file at the same time. CVS kicks out such conflicts and lets the
humans resolve it.
There are several ways to run CVS:
The following assumes that you are working from a UNIX shell. Other
clients will have similar functionality, though hopefully with a more
intuitive interface.
The following examples assume that a repository and $CVSROOT has already
been set up and defined and the project you want to work on has already been
imported into CVS.
CVS has many commands and
options, but 90% of the time you will use only these commands:
The other 10% of the time, you can either read the
documentation or ask
the resident guru.
This will check out a version of a project called basilsart and stick in
a directory called src, which will be created if it does not already exist.
Note that after this point you will not have to specify where the
repository is in any subsequent cvs command since cvs will remember where
you checked out your version from.
If you had $CVSROOT defined as
:pserver:kalb@cvs.ontash.com:/home1/CVSROOT or its equivalent, you could
have just said "cvs checkout -d src basilsart".
Use the -D option to check out a version by date:
CVS is used to dealing with text files. If you want to add a binary
file, you have to tell CVS that you are doing this, using the -kb option:
After -m is the log message. It should describe the nature of the
changes that you are committing.
If you don't give it a list of files (as above), then it will commit all
the files that have changed since the last commit or checkout.
If commit complains of errors, then you probably have to do an update
before you can do a commit, which you should do in any case if you suspect
others have been committing changes as well.
For more in-depth info, see
either the
Quick Reference, the Guide to CVS
Commands or, most definitive of all, the Cederqvist.
A good book which I have and recommend is Open Source Development
with CVS by Karl Fogel, which allows you learn CVS to the depth you
wish.
Running CVS
Basic Commands
login
checkout
update
add
commit
% cvs -d :pserver:kalb@cvs.ontash.com:/home1/CVSROOT login
where kalb is the username, cvs.ontash.com is the domain of the machine and
/home1/CVSROOT the path of the repository. CVS will ask you for your
password. For a give repository you will only have to log in once: after
that cvs will write a .cvspass file in your $HOME directory to remember
your password.
% cvs -d :pserver:kalb@cvs.ontash.com:/home1/CVSROOT checkout -d src basilsart
% cvs checkout -D 2001-03-13 20:05 -d src basilsart
% cvs update
% cvs add foo.c bar.h
% cvs add -kb map.jpg exit.gif
% cvs commit -m "fixed closed query confirmation page bug"
Links
Created Tue Mar 13 22:17:55 2001
by Stephen Kalb.
![]() ![]() |