How do I tell Subversion to treat a file as a binary file?

前端 未结 10 1002
日久生厌
日久生厌 2020-11-30 21:35

How do I tell Subversion (svn) to treat a file as a binary file?

相关标签:
10条回答
  • 2020-11-30 22:26

    If using tortoise svn in Windows, right click on the file and go to properties. Click on new and add a new property of type svn:mime-type. For the value put: application/octet-stream

    0 讨论(0)
  • 2020-11-30 22:31

    If 'svn add' guesses the incorrect type and gives you an error like the following:

    svn: E200009: File 'qt/examples/dialogs/configdialog/images/config.png' has inconsistent newlines
    svn: E135000: Inconsistent line ending style
    

    then the workaround is to add the file without properties and then set the properties in a second step:

    svn add --no-auto-props qt/examples/dialogs/configdialog/images/config.png
    svn propset svn:mime-type image/png qt/examples/dialogs/configdialog/images/config.png
    
    0 讨论(0)
  • 2020-11-30 22:38

    As per the Subversion FAQ, you can use svn propset to change the svn:mime-type property to application/octet-stream

    0 讨论(0)
  • 2020-11-30 22:38

    It usually does this by default for you, but if it isn't you need to look into file properties and propset.

    0 讨论(0)
提交回复
热议问题