Recipe 18.8. Deleting Files from a CVS Repository

 < Day Day Up > 

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

  • Chapter 2 of Essential CVS

  • Recipe 18.19

  • CVS home page (https://www.cvshome.org)

     < Day Day Up > 


    Linux Cookbook
    Linux Cookbook
    ISBN: 0596006403
    EAN: 2147483647
    Year: 2004
    Pages: 434

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