How does Subversion handle binary files?

When you first add or import a file to Subversion, the file is examined to determine if it is a binary file. Currently, Subversion only looks at the first 1024 bytes of the file; if any of the bytes are zero, or if more than 15 percent are not ASCII printing characters, then Subversion calls the file binary. This heuristic might be improved in the future.

If Subversion determines that the file is binary, the file receives an svn:mime-type property set to application/octet-stream. You can always override this by using the auto-props feature or by setting the property manually with svn propset. Subversion treats the following files as text:

All other files are treated as binary, meaning that Subversion will not::

In all other respects, Subversion treats binary files the same as text files, e.g. if you set the svn:keywords or svn:eol-style properties, Subversion will perform keyword substitution or newline conversion on binary files.

Note that whether or not a file is binary does not affect the amount of repository space used to store changes to that file, nor does it affect the amount of traffic between client and server. For storage and transmission purposes, Subversion uses a diffing method that works equally well on binary and text files; this is completely unrelated to the diffing method used by the svn diff command.