cvs binary file example - fix a binary file with cvs admin

Several times when working with CVS I've forgotten to check a binary file into CVS with the binary file flag. Fortunately this problem can be fixed using the cvs admin command. It's just important to remember that fixing this problem is a two-step operation.

For example, let's assume that I just checked a binary file named myfile.zip into my CVS repository, but I forgot to specify the binary flag. In Step 1 of the solution, I can now use the following "cvs admin" command to tell CVS to treat this file as a binary file:

cvs admin -kb myfile.zip

However, that step alone does not fix the file; in fact, the file you checked in before is corrupt and useless. So, in Step 2 of this solution, I now need to commit a new version of the binary file. When doing this, CVS will now properly treat this new file as a binary file.

Follow up

I ran into this problem again yesterday, and based on that experience, I think it's safe to say that the file checked in initially is worthless. Yesterday I imported a project into CVS, including a group of Java jar files (which are binary files), and then checked my project out on another workstation. The jar files on that workstation were corrupt. By following my notes (above) I was able to get good files into the repository ... I just didn't emphasize the part about putting new, good files in place of the bad, corrupt files, so I just added the "Step 1" and "Step 2" wording above.