gpt4 book ai didi

git - 如何告诉 Git settings.html 是文本,而不是二进制文件

转载 作者:太空狗 更新时间:2023-10-29 13:53:38 26 4
gpt4 key购买 nike

Win7,git 1.8.3.1(来自 git-scm.org)。

我有一个 git 认为是二进制的 settings.html 文件。当我在分支之间进行比较时,我看到:

[master]> git diff master work2
diff --git a/settings.html b/settings.html
index 2e46976..620dff4 100644
Binary files a/settings.html and b/settings.html differ

我已尝试将 settings.html 保存、提交和推送为

  • Unicode (UTF-8 with signature) -- Codepage 65001
  • UTF-8, no signature
  • US-ASCII codepage 20127

没有快乐; git 认为这个 html 文件是二进制文件。
我怎样才能让 git 将这个——以及所有 html 文件——当作文本来处理?
(我怀疑VS2012在搅浑水,但项目中的其他html/css/js文件都被当作文本处理。)

感谢您的任何见解...

最佳答案

将以下内容添加到存储库根目录中名为 .gitattributes 的文件中:

*.html text

参见 gitattributes(5)获取更多信息。

关于git - 如何告诉 Git settings.html 是文本,而不是二进制文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17115831/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com