Moving Files or Directories
There is no CVS command designed specifically to move a file or file directory. In fact, CVS’s design doesn’t accomodate such moves. However, you can work around this limitation using a combination of CVS commands, or by altering the repository using operating-system commands. Moving files can make project history difficult to track, because then a file’s history is recorded across two different files in different locations. Minimize this potential source of confusion by recording the new and old locations with meaningful log messages.
Tip
To rename a file or directory at the operating-system level, move it from the old filename to the new filename. For example, use the Unix mv command.
Moving Files
The
recommended way to move a file is to use cvs
remove followed by cvs add, with
messages that state where the file was moved from and to. This method
preserves the file’s history and allows reversion to
earlier versions of the project in its old location. However, the
messages stored with the add and
remove commands are the only record of the move.
Example 3-19 shows this method being used to rename
the wizzard.h file.
Example 3-19. Renaming a file
bash-2.05a$mv wizzard.h config.hbash-2.05a$cvs remove wizzard.hcvs server: scheduling `wizzard.h' for removal cvs server: use 'cvs commit' to remove this file permanently bash-2.05a$cvs add config.hcvs server: scheduling file `config.h' for addition cvs server: use 'cvs commit' to add this file permanently bash-2.05a$ ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access