[英]Prevent GIT from changing automatically character encoding
I face a problem as below.我面临如下问题。 Please give me a solution.
请给我一个解决方案。 Thanks in advance!
提前致谢!
I use Linux OS (ubuntu)我使用 Linux 操作系统 (ubuntu)
Initially, I checkout new branch with the file test.properties file encoding:最初,我使用文件test.properties文件编码签出新分支:
test.properties: text/plain; charset=unknown-8bit
Intellij Seting file encoding: Intellij 设置文件编码:
on Browser, the text show like:在浏览器上,文本显示如下:
# 基本情報
I only add '#' character for one line, then I commit file, push my_branch to my repository I run git diff
command:我只为一行添加“#”字符,然后我提交文件,将 my_branch 推送到我的存储库我运行
git diff
命令:
git diff
-# <8A><EE><96>{<8F><EE><95><F1>
+## \u57FA\u672C\u60C5\u5831
.... other lines are also changed into UTF-8 encoding. ....其他行也改成UTF-8编码。
How can I prevent the problem?我怎样才能防止这个问题? Simply, It just marks as below: My expectation looks like this:
简单地说,它只是标记如下:我的期望是这样的:
-# <8A><EE><96>{<8F><EE><95><F1>
+## <8A><EE><96>{<8F><EE><95><F1>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.