windows - Git 为 *.reg 文件显示 "Binary files a... and b... differ"

标签 windows git registry

有没有办法强制 Git 将 .reg 文件视为文本?我正在使用 Git 来跟踪我的 Windows 注册表调整,Windows 使用 .reg 来存储这些文件。

更新 1: 我得到它来运行 diff(感谢 Andrew)。但是,现在它看起来像下面这样。这是编码问题吗?

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^@
...

有什么想法吗?

更新 2: 感谢所有提供帮助的人:这是我最后所做的:创建文件 .gitattributes 内容为 *.reg text diff 然后我将文件转换为 UTF-8,因为 UTF-16 与差异很奇怪。我没有使用任何外来字符,所以 UTF-8 适合我。

最佳答案

要告诉 git 显式区分文件类型,请将以下内容放在 .gitattributes 中存储库根目录中的文件:

*.reg diff

关于windows - Git 为 *.reg 文件显示 "Binary files a... and b... differ",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5046032/

相关文章:

c# - 在 C# 中创建远程 PowerShell session ?

git - 从 Git 存储库中的历史记录中删除空的 merge 提交

Github for mac diff 选项

c# - 我无法访问注册表条目中的某些子项

PowerShell 获取具有最大属性值的注册表项

c++ - 如何更改注册表项的 ACL? (C++)

windows - 你能得到 NativeWindow 的最小化事件吗?

windows - 无法在 Go 中编译测试程序

pull 时出现 Git fatal error ,无法锁定引用,无法解析引用,引用已损坏

windows - AMD64 页面条目基地址字段如何将 52 位地址编码为 40 位?