60 likes | 240 Vues
Add New File or a Directory to a Project in the Repository. To add a file to a project in the repository, first create the file in your sandbox. Consider your project's structure and place the file in the correct directory.
E N D
To add a file to a project in the repository, first create the file in your sandbox. • Consider your project's structure and place the file in the correct directory. • Then, issue the following command from the sandbox directory containing the file: cvs add filename
This command marks the new file for inclusion in the repository. • Directories are added with the same command. Files within a directory can't be added until the directory itself is added. • A file is only marked for addition when you run cvs add; it is actually added to the repository when the next cvs commit is run. • A directory is added to the repository immediately.
Example • This example shows a file being created and added to the repository. $ touch file3 $ cvs add file3 cvs add: scheduling file `file3' for addition cvs add: use 'cvs commit' to add this file permanently $ cvs commit
The Attic and CVS directoriesare 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.
Another example Usingcvs add $ 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