如何告诉 Subversion 将文件视为二进制文件? [英] How do I tell Subversion to treat a file as a binary file?

查看:26
本文介绍了如何告诉 Subversion 将文件视为二进制文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何告诉 Subversion (svn) 将文件视为二进制文件?

解决方案

可以使用以下方法手动将位于存储库中的文件标识为 二进制:

svn propset svn:mime-type application/octet-stream 

这通常不是必需的,因为 Subversion 会在第一次添加文件时尝试确定文件是否为二进制文件.如果 Subversion 在应该将其视为二进制时错误地将某种类型标记为文本",则可以配置 Subversion 的 自动道具功能 使用非文本 MIME 类型自动标记该文件.不管文件上配置的属性如何,Subversion 仍然以二进制格式将文件存储在存储库中.

如果 Subversion 将 MIME 类型识别为文本"类型,它会启用某些二进制文件不可用的功能,例如 svn diffsvn blame.它还允许自动行结束转换,可在逐个客户端的基础上进行配置.

有关更多信息,请参阅Subversion 如何处理二进制文件?>

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

解决方案

It is possible to manually identify a file located within a repository as binary by using:

svn propset svn:mime-type application/octet-stream <filename>

This is generally not necessary, as Subversion will attempt to determine whether a file is binary when the file is first added. If Subversion is incorrectly tagging a certain type as "text" when it should be treated as binary, it is possible to configure Subversion's auto-props feature to automatically tag that file with a non-text MIME type. Regardless of the properties configured on the file, Subversion still stores the file in a binary format within the repository.

If Subversion identifies the MIME type as a "text" type, it enables certain features which are not available on binary files, such as svn diff and svn blame. It also allows for automatic line ending conversion, which is configurable on a client-by-client basis.

For more information, see How does Subversion handle binary files?

这篇关于如何告诉 Subversion 将文件视为二进制文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆