Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

svn diff: file marked as binary type

Tags:

svn

file-type

I'm doing an svn diff on one of my files and svn is detecting it as a binary type. The file is readable plain text and I would like to be able to get a diff of this file. How do I tell SVN that this is not a binary file?

Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream 
like image 450
Charles Ma Avatar asked Apr 14 '10 00:04

Charles Ma


People also ask

How does svn handle binary files?

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: Files with no svn:mime-type.

What is the use of svn diff command?

The svn diff command reveals the differences between your working copy and the copy in the master SVN repository.

How does svn store changes?

Each time you commit a change, the repository stores a new revision of that overall repository tree, and labels the new tree with a new revision number. Of course, most of the tree is the same as the revision before, except for the parts you changed.


2 Answers

You can get diff even for a file marked as binary by using --force.

svn diff --force path/to/file

like image 83
Evgeny Remizov Avatar answered Sep 23 '22 18:09

Evgeny Remizov


You can use the Subversion property svn:mime-type to set an explicit mimetype on the file:

 svn propset svn:mime-type 'text/plain' path/to/file 

Alternatively, you can delete this property (since Subversion assumes plaintext, otherwise) using:

 svn propdel svn:mime-type path/to/file 
like image 43
Michael Aaron Safyan Avatar answered Sep 20 '22 18:09

Michael Aaron Safyan