Thornleyware logo

Providing customized source code control with CVS

Moving a File

There are three ways to move files in CVS. None are perfect, but one of them will probably do what you need it to.

cvs rm and cvs add: This is the simplest CVS solution. It can be performed by the user as well as the administrator, has no other side effects, and will not cause problems with old files (except if you're trying to change whether the file is binary or not).

The disadvantage is that CVS has no connection between the file with the old name and the file with the new. It is not possible to use CVS to do diffs or merges across the name change, and the log history of the file will be in two separate places. This may or may not be important.

Moving in the repository: This keeps the history, but breaks the history of the archive as a whole. Since the file has been moved in the repository with all of its history, any checkouts on an earlier tag will get the file in its present form. The other disadvantage is that, if the new file name and location was previously used, the old file must be discarded or itself moved.

Copying in the repository: This keeps the history and the reproducibility of past tags, and therefore is one of the better ways. It is necessary to strip the file in the new location of its earlier tags, or otherwise the new version can be checked out with those tags. Branch tags should be removed from one or the other version. The most likely problem with this method is that it will conflict with an earlier file of the same name.

All contents of these pages Copyright 2002 by David H. Thornley.
Permission granted for verbatim copying and use within an organization.


Contact: webmaster@thornleyware.com