CVS (Concurrent Versions System) is a source code manager. It helps managing multiple versions of a software that is evolving.
CVS duplicates a software development source tree within a directory called repository. In this tree, each file is replaced by a file in the RCS format (Revision Control System, CVS' ancestor). This file contains the latest version of a file as well as differences, allowing to rollback to a previous version as needed. It also contains comments made by the commiter of each changes as well as the version number and date.
On can also use CVS to define secondary branches, for experimental features for example, which may, further down the road, be merged to the main branch (or trunc).
CVS can be used to work on a project with a team. Indeed, it allows to pull changes made by others and merge them with ours, or to push our changes to the central repository.
The central repository may be located either on the computer on which CVS commands are run, or on a remote compute.
- We define the CVSROOT environment variable to point toward the repository. The repository may be
- local (CVSROOT=/directory/cvsroot),
- remote with the pserver method (CVSROOT=:pserver:email@example.com:/directory/cvsroot),
- remote with the rsh or ssh methods (CVSROOTfirstname.lastname@example.org:/directory/cvsroot). If we want to use ssh, the CVS_RSH environment variable must be set to "ssh".
- For a remote repository with the pserver method, we must log with the "cvs login" command and provide the password (which must of course be known by you).
- To pull a module from the CVS repository, you run, for example, the command " cvs checkout siesta ". This will create a directory siesta with the latest version.
- To add a new file to the CVS repository, you run " cvs add filename ".
- To remove a file from the CVS repository, you run " cvs remove filename ".
- To update your local version with respect to the repository, you run " cvs update ". If there are conflicts between your changes and those of someone else, CVS will tell where those conflicts are and you need to resolve them before the next step.
- To push your changes to the repository, you run " cvs commit filename ".