3

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)——代码页 65001
  • UTF-8,无签名
  • US-ASCII 代码页 20127

没有喜悦;git 认为这个 html 文件是二进制的。
我怎样才能让 git 把它——以及所有的 html 文件——当作文本?
(我怀疑 VS2012 搅浑水,但项目中的其他 html/css/js 文件被视为文本。)

感谢您的任何见解...

4

1 回答 1

6

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

*.html text

有关更多信息,请参阅gitattributes(5)

于 2013-06-14T20:13:10.460 回答