Repository -- CVS---Concurrent Versions System



Next: Starting a new project Prev: A sample session Top: Top

4. The Repository

Figure 3 below shows a typical setup of a repository. Only directories are shown below.

/usr

|

+--local

| |

| +--cvsroot

| | |

| | +--CVSROOT

| (administrative files)

|

+--gnu

| |

| +--diff

| | (source code to gnu diff)

| |

| +--rcs

| | (source code to rcs)

| |

| +--cvs

| (source code to cvs)

|

+--yoyodyne

|

+--tc

| |

| +--man

| |

| +--testing

|

+--(other Yoyodyne software)

There are a couple of different ways to tell cvs where to find the repository. You can name the repository on the command line explicitly, with the -d (for "directory") option:

cvs -d /usr/local/cvsroot checkout yoyodyne/tc

Or you can set the $CVSROOT environment variable to an absolute path to the root of the repository, /usr/local/cvsroot in this example. To set $CVSROOT, all csh and tcsh users should have this line in their .cshrc or .tcshrc files:

setenv CVSROOT /usr/local/cvsroot

sh and bash users should instead have these lines in their .profile or .bashrc:

CVSROOT=/usr/local/cvsroot

export CVSROOT

A repository specified with -d will override the $CVSROOT environment variable. Once you've checked a working copy out from the repository, it will remember where its repository is (the information is recorded in the CVS/Root file in the working copy).

The -d option and the CVS/Root file both override the $CVSROOT environment variable; however, CVS will complain if the -d argument and the CVS/Root file disagree.

There is nothing magical about the name /usr/local/cvsroot. You can choose to place the repository anywhere you like. See Remote repositories to learn how the repository can be on a different machine than your working copy of the sources.

The repository is split in two parts. $CVSROOT/CVSROOT contains administrative files for cvs. The other directories contain the actual user-defined modules.

Menu

User modules
The structure of the repository
Intro administrative files
Defining modules
Multiple repositories
Multiple repositories
Creating a repository
Creating a repository
Remote repositories
Accessing repositories on remote machines


Next: Starting a new project Prev: A sample session Top: Top