Use cvs add to add a file or directory to the repository. Using cvs add on a file marks the file as needing to be added when cvs commit is run. Running cvs add on a directory adds the directory to the repository and the CVS subdirectory to the directory.
The Attic and CVS directories are special directories that CVS uses for its own purposes. Do not make a file or directory with these names .
You can use cvs remove to remove a file that has been added but not committed. This removes the marking in the CVS subdirectory and doesn't record the aborted addition in the repository's history. Similarly, you can use cvs add to abort a file removal; it will resurrect the file without recording the aborted removal.
The file or directory to be added must exist within the sandbox, and a directory must not contain a file or subdirectory named CVS .
In the process of adding a file, CVS strips trailing slashes and any special CVS files from the arguments, then checks for name conflicts (including some case-comparison testing). If CVS detects a name conflict, it notifies the user and does not add the file or directory.
cvs add uses the following syntax:
cvs [ cvs-options ] add [ command-options ] filename
The available options are -k, followed by any of the keyword flags, and -m, followed by an addition message. Keyword flags set default keyword-substitution modes. The most common keyword flag used with cvs add is -kb , used to add binary files. Any message specified using -m becomes the description message for the file (displayed in cvs log output) and is stored with the file when the file is committed. At least one filename must be used, and the file or directory to be added must exist.
Keyword modes that are arguments to cvs add combine to become the default mode for the file. See Section 3.10 and Section 3.11 later in this chapter.
Example 3-14 shows using cvs add to add directories and files.
bash-2.05a$ cvs add design plan design/*.rtf plan/*.rtf Directory /var/lib/cvs/wizzard/doc/design added to the repository Directory /var/lib/cvs/wizzard/doc/plan added to the repository cvs server: scheduling file `design/Analysis.rtf' for addition cvs server: scheduling file `design/Specification.rtf' for addition cvs server: scheduling file `plan/Schedule.rtf' for addition cvs server: use 'cvs commit' to add these files permanently
CVS can store only files that can be converted to RCS format. Files cannot be added to the repository if they are actually devices, symbolic links, or other files that are not persistent or that cannot be opened or modified. To record these files as part of your project, include the commands to construct them in your build or installation scripts and store those scripts in CVS.