Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cvs, "file should be removed and is still there (or back again)"

I am trying to commit a project in which a file has been "cvs remove"d, but actually needs to be there. The contents has been completely rewritten, but it needs to retain the same name.

I am unable to either commit the project or re-add the file without getting this annoying error message. How do I "unremove" a file in CVS?

like image 305
Chris Huang-Leaver Avatar asked Aug 17 '09 11:08

Chris Huang-Leaver


People also ask

How do you delete CVS files?

You can for instance use rm . Use ' cvs remove filename ' to tell CVS that you really want to delete the file. Use ' cvs commit filename ' to actually perform the removal of the file from the repository.

How do I rollback CVS?

cvs export the 'old version' by tag (or you could do it by date) into a new folder. ensure the 'current version' is checked out, updated, and live. copy the files from the old version into the folder with the current version.


1 Answers

This worked for me:

  1. Rename the file

    mv mistakenly_removed_file wtf
    
  2. Ask cvs to add the old version:

    cvs add mistakenly_removed_file
    
  3. cvs then reports it has resurrected the removed file.

    mv wtf mistakenly_removed_file
    

cvs status reveals that the file is now "locally modified"

like image 65
Chris Huang-Leaver Avatar answered Sep 28 '22 02:09

Chris Huang-Leaver