Previous Section  < Day Day Up >  Next Section

Recipe 18.8. Deleting Files from a CVS Repository

18.8.1 Problem

You want to delete some files from your CVS repository.

18.8.2 Solution

Delete the file from your sandbox, then run the cvs remove command:

$ rm badfile

$ cvs remove badfile

cvs remove: scheduling 'badfile' for removal

cvs remove: use 'cvs'commit' to remove this file permanently

The next time you run a commit, the file will be moved to a special subdirectory called Attic. This preserves the file history and allows you to restore the file, should you change your mind.

Alternatively you can use a single command to delete the file from both your sandbox and repository:

$ cvs remove -f badfile

18.8.3 Discussion

You can't remove directories like you can remove files. Using the -P flag for update and checkout prevents empty directories from being downloaded to your sandbox. A common shortcut is to make this the default behavior in ~/cvsrc (see Recipe Recipe 18.19).

CVS never really deletes anything. It's not supposed to. If you have a "spring cleaning" mindset you may find CVS a bit frustrating, because you're not supposed to clean its closets. The purpose of using a version control system is to maintain a complete history of a project.

18.8.4 See Also

    Previous Section  < Day Day Up >  Next Section