-- EladLahav - 25 Nov 2005
CVS is an easy to use, yet powerful and effective version control system. It is based on a client-server architecture that stores all files in a common place, thus allowing sevral people to collaborate on a project.
Common terms used by CVS:
Working with CVS usually involves the following stages:
We shall assume that a repository was already created and that it is accessed only through rsh/ssh. The root will be
:ext:elahav@hopper:/u3/elahav/cvsroot
where :ext:
means that the repository can only be accessed using rsh, elahav
is the user name, hopper
is the server on which the repository resides and /u3/elahav/cvsroot
is the path to the repository.
CVS_RSH
to ssh
.
Every CVS command has the following form:
cvs CVS_OPTIONS COMMAND COMMAND_OPTIONS
Most CVS commands work recursively, which means they are applied to all sub-directories.
The import process creates a new module in the repository. The module is populated with all files in the current directory. The command has the following syntax:
cvs -d ROOT import MODULE_NAME VENDOR_TAG START_TAG
where ROOT
is the repository's root string, MODULE_NAME
is simply the name of the module, and VENDOR_TAG and START_TAG are arbitrary symbols.
-d ROOT
part by setting the CVSROOT
environment variable to the root string.
Assume ~/src/myproject
is a directory containing the files to import. The following commands create the module myproject
in the repository
cd ~/src/myproject cvs -d :ext:elahav@hopper:/u3/elahav/cvsroot import myproject VENDOR START
Alternatively, we can use the CVSROOT
environment variable:
export CVSROOT=:ext:elahav@hopper:/u3/elahav/cvsroot cd ~/src/myproject cvs import myproject VENDOR START
Since CVS works recursively, all sub-directories and their files will also be imported.
The checkout command creates a tree by copying the latest version of all files in a module into a the current directory. Its basic syntax is:
cvs -d ROOT co MODULE_NAME
Checkout can also create the tree in a specified directory:
cvs -d ROOT co -d DIR MODULE_NAME
For example, to check out the myproject
module in the current directory
cvs -d :ext:elahav@hopper:/u3/elahav/cvsroot co myproject
or, if CVSROOT
has already been set correctly
cvs co myproject
This command creates a directory called myproject
under the current directory, populated with the module files (including all sub-directories). Each directory in the tree has a CVS sub-directory, which contains such information as the name of the module, its root and the files in this directory that are included in the module.