Git说“二进制文件a ...和b ...不同”打开* .reg文件 [英] Git says "Binary files a... and b... differ" on for *.reg files
问题描述
有没有办法强制Git将 .reg
来处理这些文件。
更新1:我得到它运行差异(谢谢,安德鲁)。但是,现在看起来如下所示。这是一个编码问题?
索引0080fe3..fc51807 100644
--- a /安装重建/ 4 。注册表Tweaks.reg
+++ b /在重建时安装/ 4。 Registry Tweaks.reg
@@ -1,49 +1,48 @@
- < FF>< FE> w ^ @ i ^ @ n ^ @ d ^ @ o ^ @ w ^ @ s ^ @ ^ @ r ^ @ e ^ @ g ^ @ i ^ @ s ^ @ t ^ @ r ^ @ y ^ @ ^ @ E ^ @ d ^ @ i ^ @ t ^ @ o ^ @ r ^ @
- ^ @; ^ @; ^ @; ^ @; ^ @; ^ @; ^ @; ^ @; ^ @; ^ @; ^ @; ^ @; ^ @; ^ @; ^ @; ^ @; ^ @; ^ @; ^ @; ^ @; ^ @; ^ @; ^ @; ^ @; ^ @; ^ @;
- ^ @ ^ M ^ @
...
任何想法?
更新2:感谢所有帮助过的人:以下是我最后做的事情:创建文件 Is there a way to force Git in to treating UPDATE 1: I got it to run a diff (thanks, Andrew). However, now it looks like this below. Is this an encoding issue? Any ideas? UPDATE 2: Thanks all who helped: here's what I did in the end: create file To tell git to explicitly diff a filetype, put the following in a
这篇关于Git说“二进制文件a ...和b ...不同”打开* .reg文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! .gitattributes
,内容为
* .reg text diff
,然后我将这些文件转换为UTF-8,因为UTF-16对diffs很奇怪。我没有使用任何外来字符,所以UTF-8适用于我。 为了告诉git显式地区分文件类型,将以下内容放在 .gitattributes
$ p $ *。reg diff
code> .reg
files as text? I am using Git to track my windows registry tweaks and Windows uses .reg
for these files.index 0080fe3..fc51807 100644
--- a/Install On Rebuild/4. Registry Tweaks.reg
+++ b/Install On Rebuild/4. Registry Tweaks.reg
@@ -1,49 +1,48 @@
-<FF><FE>W^@i^@n^@d^@o^@w^@s^@ ^@R^@e^@g^@i^@s^@t^@r^@y^@ ^@E^@d^@i^@t^@o^@r^@
-^@;^@;^@;^@;^@;^@;^@;^@;^@;^@;^@;^@;^@;^@;^@;^@;^@;^@;^@;^@;^@;^@;^@;^@;^@;^@;
-^@^M^@
...
.gitattributes
with content *.reg text diff
and then I converted the files to UTF-8 as UTF-16 is weird with diffs. I'm not using any foreign characters so UTF-8 works for me..gitattributes
file in your repository’s root directory:*.reg diff