Wednesday, January 12, 2011

How to remove files or directories in CVS?

To remove files, you first schedule the files for removal, and then commit the change:

1. Select the file or files that you want to remove.
2. Click the right mouse button on the selection, and choose the Remove selection menu item. (See the Note below if you can’t find the Remove select menu item.)
3. As the files are only marked for removal, you have to commit them to remove them from the repository. See Sending Your Changes to CVS if you don't know how to commit.

Note: If you can’t find the Remove selection menu item, then: Right click on any file -> Select “Customize this menu…” -> Add the “Remove selection” item on Customize menus window. -> Click OK.

The files will now be removed from the repository. Note that files are not physically removed, but rather marked as "dead". By this way it will still be possible to retrieve the files if you choose to check out an old version of the module.

Removing directories is another story. CVS will optionally remove empty directories when you update one of its parent directories. If you want to get rid of an empty directory, do the following:
1. Select the parent directory of the empty directory you want to remove.
2. Click the right mouse button on the selection, and choose the Update selection menu item.
3. Select the Globals tab.
4. Make sure Prune (remove) empty directories is checked (it is by default).
5. Press the OK button.

The directory will be removed if all its files were previously removed from your local copy and from the repository.

No comments: