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

时间:2013-06-14 19:22:40

标签: git

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 codepage 20127
  •   

没有快乐; git认为这个html文件是二进制文件 我如何得到git来处理这个 - 以及所有的html文件 - 作为文本?
(我怀疑VS2012正在混淆水域,但项目中的其他html / css / js文件被视为文本。)

感谢您的任何见解...

1 个答案:

答案 0 :(得分:6)

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

*.html text

有关详细信息,请参阅gitattributes(5)

相关问题