Noeud:Creating a new CVS repository, Noeud « Next »:, Noeud « Previous »:Why the bother, Noeud « Up »:Source Code Management



Creating a new CVS repository

In general, it is better to have a single repository that can be professionally maintained and backed up. That may not be possible if there is none available or if there are reasons why you must keep your work in a separate repository. In such cases, you will need to create your own. Fortunately, that is easily done.

First, you must determine where you can and should place it. The repository will start out somewhat larger than the original sources and will tend to grow monotonically with time. That is to say, it is rare to see the size do anything except get bigger. Much bigger. Another reason for looking beyond your home directory is that you may wish to share the data with others. Home directories are considered fairly private places.

Before we go and create the repository, though, a few things need to be decided. If this new repository is for the use of a single user, you need to make sure that the created repository has user-only write permissions on the directories. Otherwise, access control in CVS is generally based on group membership permissions. Consequently, it is generally a good idea to set up a special purpose group ID so that the various CVS users can become members of it.

Now, create the repository directory with the appropriate group ownership and group write privileges:

     CVSROOT=/path/to/repository
     cvs -d $CVSROOT init
     find $CVSROOT | xargs chmod g+w
     

For a personal repository, the only required command is the "cvs init" command. For a shared repository, the "find ... | xargs chmod" thing is crucial in order to allow other group members access to the repository.

At this point, it would also be convenient to save the value of the CVSROOT environment variable where your login shell will find it for the next time you login. You can do this by editing your initialization script file for your particular shell to contain either this:

     CVSROOT=/path/to/repository
     export CVSROOT
     

or something fairly similar, if you use csh or a derivative. CVS uses that environment variable when it cannot locate "./CVS/Root".

At this point, you now have a working CVS repository. It's just empty. It is time to either start a new project, Voir Starting a new project, or install a pre-existing project, Voir Installing a pre-existing project.