How do I move or rename a file?

By Alvin J. Alexander, devdaily.com

Good question. This is neither obvious or straightforward with CVS. It also requires administrator priviledge.

To move a file and save it's revision history, do the following:

  • In the repository copy the file to the new name or location.
  • Then in a working copy of the repository, move to the directory where the original file exists, then execute these commands to actually remove the original file:
  rm oldfile
  cvs remove oldfile
  cvs commit -m "moved to newfile" oldfile


devdaily logo