LinuxCommandLibrary

cvs

Manage concurrent access to source code

TLDR

Create a new repository (requires the CVSROOT environment variable to be set externally)

$ cvs -d [path/to/repository] init
copy

Add a project to the repository
$ cvs import -m "[message]" [project_name] [version] [vendor]
copy

Checkout a project
$ cvs checkout [project_name]
copy

Show changes made to files
$ cvs diff [path/to/file]
copy

Add a file
$ cvs add [path/to/file]
copy

Commit a file
$ cvs commit -m "[message]" [path/to/file]
copy

Update the working directory from the remote repository
$ cvs update
copy

SYNOPSIS

cvs [cvs-options] command [command-options] [command-arguments]

PARAMETERS

-H
    Display global help message.

-v
    Display CVS version information.

-Q
    Operate quietly, printing only serious error messages.

-q
    Operate somewhat quietly.

-d repository
    Specify the root directory of the CVS repository.

-f
    Do not read the cvsrc file.

-l
    Log all client-server communication in ~/.cvs/cvs.log

checkout
    Check out sources for editing.

commit
    Check in changes to the repository.

update
    Bring working copy up to date with the repository.

add
    Add a new file or directory to the repository.

remove
    Remove a file or directory from the repository.

diff
    Show differences between working copy and repository.

log
    Display log information about a file or directory.

status
    Display status information about working copy files.

DESCRIPTION

The Concurrent Versions System (CVS) is a client-server revision control system. It allows multiple developers to work on the same set of files concurrently. CVS maintains a central repository that stores all versions of the files. Developers check out working copies of files from the repository, make changes, and commit their changes back to the repository. CVS manages conflicts that arise when multiple developers modify the same file. It uses a system of branching and merging to resolve these conflicts.
CVS is older and less feature-rich than newer version control systems like Git, but it's still used in some legacy projects. Its primary function is to manage concurrent access to files and track changes over time, enabling teams to collaborate effectively on software development and other projects involving text-based files.

CAVEATS

CVS is an older system and lacks many features found in modern version control systems like Git. Conflict resolution can be cumbersome. Branching and merging are less powerful and flexible than in Git.

CONCURRENCY MODEL

CVS uses an optimistic concurrency model. Multiple developers can work on the same file simultaneously. Conflicts are detected during commit and must be resolved manually.

REPOSITORY STRUCTURE

A CVS repository is typically organized as a directory tree. The top-level directory is the repository root. Within the repository, modules (projects) are stored as subdirectories. Each file's history is stored within the corresponding module's subdirectory.

HISTORY

CVS was initially developed in the mid-1980s by Dick Grune as a set of shell scripts. In the late 1980s, Brian Berliner rewrote it in C. CVS became widely used throughout the 1990s and early 2000s as a standard version control system, especially in open-source projects. Its popularity declined with the rise of newer systems like Subversion and Git, which offer more advanced features and better performance.

SEE ALSO

rcs(1), diff(1), patch(1)

Copied to clipboard