SVN差异:为什么某些文件标记为二进制 [英] SVN Diff: Why are some files marked as binary
问题描述
直接相关: svn diff:文件标记为二进制类型 (根据对答案的评论)
为什么我的SVN客户端会将某些文件标记为二进制文件?
Why would my SVN client mark some files as binary?
具体来说,使用TortoiseSVN时.sql
具有道具svn:mime-type = application/octet-stream
.
Specifically, .sql
has prop svn:mime-type = application/octet-stream
when using TortoiseSVN.
我选中了右键单击> Tortoise上下文菜单>设置>常规> Subversion配置文件,并且[miscellany]
或[auto-props]
中没有未注释的,所以决定从何而来?
I checked Right-click > Tortoise context menu > Settings > General > Subversion configuration file, and nothing is uncommented in [miscellany]
or [auto-props]
, so where is the decision coming from?
从相关文章中可以看到,我可以通过删除受影响文件的属性来修复它",或者通过config/setting全局更改新文件的行为,但是有一种简单"的方法可以对所有受影响的文件都做?
From what I can see in the related posts, I can "fix it" by either deleting the property on affected files, or globally change the behavior on new files via config/setting, but is there a "simple" way to do both for all affected files?
有些相关:
- Persistently overriding svn's mime to binary mapping?
- svn diff for binary file(excel file)
推荐答案
好吧,我发现了我的特殊情况下的问题:
Well, I found the issue in my particular case:
开发人员已保存了用于新脚本的模板.sql
文件.该文件以某种方式保存为UCS-2
(或Unicode
)编码.每当他添加文件时,TortoiseSVN都将其确定为二进制文件.通过将编码切换为UTF-8
,可以正确地将模板和从其衍生的文件添加为text/plain
.
A developer had saved a template .sql
file he was using for new scripts. This file, somehow, was saved with UCS-2
(or Unicode
) encoding. Whenever he added files, TortoiseSVN determined that it was a binary file. By switching the encoding to UTF-8
, the template and files derived from it are added correctly as text/plain
.
其他信息(编辑)
我发现了可能是罪魁祸首.使用GUI生成某些脚本时,SQL Server Management Studio在查询窗口中将它们写为Unicode
.如果文件已保存,则文件也将另存为Unicode
.有趣的是,通过New
打开的文件不会像这样保存.早在2007年,Microsoft就对此提出了一个问题(请在此处),显然还没有解决.
I found what might have been the culprit. When generating some scripts using the GUI, SQL Server Management Studio writes them as Unicode
in the query window. If the file is saved, it will be saved as Unicode
as well. Interestingly enough, files opened via the File
>New
don't save like this. An issue was raised with Microsoft about this back in 2007 (found here), that apparently hasn't been resolved.
这篇关于SVN差异:为什么某些文件标记为二进制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!