为什么 Git 认为我的 cs 文件是二进制文件? [英] Why does Git think my cs file is binary?
本文介绍了为什么 Git 认为我的 cs 文件是二进制文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的存储库中只有一个cs 文件,Git 似乎认为它是二进制文件.(在 git gui
中,它只是说二进制文件不同".)
I have just one cs file in my repository which Git seems to think is binary. (In git gui
, it just says "binary files differ".)
如何向 Git 表明我的 cs 文件是文本文件?
How can I indicate to Git that my cs file is a text file?
推荐答案
您可以尝试将您的 cs 文件设置为 .gitattributes
文件中的文本.
You could try and set your cs files as text in a .gitattributes
file.
*.vmc diff
(如 .gitattributes
手册页)
或尝试将它们作为文本进行比较 (git diff --text
)
但是如果你的 .cs 文件是 UTF-8 或 UTF-16,这个 可能有问题,除非您将 diff
设置为使用 能够处理这些编码的外部工具.
But if your .cs files are UTF-8 or UTF-16, this can be problematic, unless you set your diff
to use an external tool able to handle those encoding.
这篇关于为什么 Git 认为我的 cs 文件是二进制文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文