A CVS repository is set up on cml.uni-bamberg.de. The following describes how to deal with binary files.

The Story

CVS does not recognize binary files by default. Yet, CVS modifies files added to the repository. The following modifications are done:
  • keyword expansion, e.g. expanding $Id:$ to $Id: readme.txt,v 1.4 2004/05/27 10:51:47 oemigldap Exp $
  • line end conversions, CR LF on Windows to only LF on Unix.
especially the last step breaks binary files when one checks out a project e.g. from a unix cvs repository to a windows machine.

What to do?

Keyword expansion and line end conversion need to be switched off for binary files. This is done by using the -kb option when adding files to the repository:
$>cvs add -kb filename

When your file is already located in the repository you can use:
$>cvs admin -kb filename

How to find out, if it has been set for a particular file?

  • Use the cvs status command:
$> cvs status -v binaryfile.gif

Console Output
File: counterfeitsquare.gif     Status: Up-to-date

   Working revision:
   Repository revision: /usr/local/cvsroot/binarytest/binaryfile.gif,v
   Sticky Tag:          (none)
   Sticky Date:         (none)
   Sticky Options:      -kb

   Existing Tags:
        start                           (revision:
        beckmann                    (branch: 1.1.1)

  • You can also inspect the Entries file within your CVS directories. There you should find the STICKY OPTION -kb as well:
$> cvs Entries

Console Output
/binaryfile.gif/ Jul 26 08:15:21 2004/-kb/
/notmarkedasbinary.gif/1.1/Mon Jul 26 08:30:45 2004//
/readme.txt/ Jul 26 08:15:21 2004//

Users [toggle]

4 online users

Internal [toggle]

Chat [toggle]