Notice how, in the second and third commands, we name newfile.f
explicitly even though it doesn't exist in the working copy anymore.
Of course, in the commit, you don't absolutely need to name the file,
as long as you don't mind the commit encompassing any other modifications
that may have taken place in the working copy.

Removing Directories

As I said before, CVS doesn't really keep directories under version
control. Instead, as a kind of cheap substitute, it offers certain odd
behaviors that in most cases do the "right thing". One of these odd
behaviors is that empty directories can be treated specially. If you
want to remove a directory from a project, you first remove all the
files in it and then run update in the directory above it with the -P flag:

The -P option tells update to "prune" any empty
directories - that is, to remove them from the working copy. Once that's
done, the directory can be said to have been removed; all of its files
are gone, and the directory itself is gone (from the working copy, at
least, although there is actually still an empty directory in
the repository).

An interesting counterpart to this behavior is that when you run a plain
update, CVS does not automatically bring new directories from the repository
into your working copy. There are a couple of different justifications for
this, none really worth going into here. The short answer is that from time
to time you should run update with the -d flag, telling
it to bring down any new directories from the repository.

Renaming Files And Directories

Renaming a file is equivalent to creating it under the new name and
removing it under the old. In Unix, the commands are:

For files, that's all there is to it. Renaming directories is not done
very differently: create the new directory, cvs add it, move all the files
from the old directory to the new one, cvs remove them from the old
directory, cvs add them in the new one, cvs commit so everything takes
effect, and then do cvs update -P to make the
now-empty directory disappear from the working copy. That is to say:

Note: the warning message after the third command. It's telling you
that it can't copy olddir's CVS/ subdirectory into newdir because newdir
already has a directory of that name. This is fine, because you want
olddir to keep its CVS/ subdirectory anyway.

Obviously, moving directories around can get a bit cumbersome. The
best policy is to try to come up with a good layout when you initially
import your project so you won't have to move directories around very
often.