Section 3.5. Adding Files to the Repository


3.5. Adding Files to the Repository

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.

If you attempt to commit and get an error message that includes *PANIC* administration files missing, you may have created a file or directory named CVS. This message means that CVS could not find the Repository file in the CVS subdirectory of the sandbox directory that it is trying to commit.


You can use cvs remove to remove a file that has been added but not committed. This command 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 resurrects 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.

Files and directories are case-sensitive in the repository. If you are using a CVS client or operating system that is not case-sensitive, you may encounter problems. Avoid using file or directory names that would be the same if case were not an issue.


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 has 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 "Keywords" and "Binary Files and Wrappers" later in this chapter.

Example 3-14 shows use of cvs add to add directories and files. Figure 3-10 shows adding a file in Pharmacy.

Example 3-14. Using cvs add

 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 

Figure 3-10. Using cvs add in Pharmacy





Essential CVS
Essential CVS (Essentials)
ISBN: 0596527039
EAN: 2147483647
Year: 2006
Pages: 148

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net