简体   繁体   English

Git 不显示某些文件的更改已提交或历史记录

[英]Git not displaying changes committed or in history for some of the files

Not sure if this was answer somewhere as searching google or stack-overflow didn't helped so far (I might use the wrong keywords).不确定这是否是某个地方的答案,因为到目前为止搜索 google 或 stack-overflow 没有帮助(我可能使用了错误的关键字)。

I'm new at using Git and have installed/tried Source-tree & Git Desktop to Pull/Push/commit from my git server.我是使用 Git 的新手,并且已经安装/尝试过 Source-tree 和 Git Desktop 从我的 git 服务器拉/推/提交。

The issue I face is that when I commit or go to check the history of the changes committed some of the changes are not displayed though the tool recognize they have changed (or are listed as committed and with change in the history).我面临的问题是,当我提交或检查已提交更改的历史记录时,尽管工具识别出它们已更改(或被列为已提交并在历史记录中发生更改),但某些更改并未显示。 I only see the message: "This binary file has changed" rather than the code changed like I see on other files ( with the same extension ).我只看到消息: “此二进制文件已更改”,而不是像我在其他文件(具有相同扩展名)上看到的代码更改。

I'm under the impression the big files are the issue but can't confirm this.我的印象是大文件是问题,但无法确认。

Would someone know if this is normal behavior or if this can be fixed somehow?有人会知道这是正常行为还是可以以某种方式修复?

Thanks.谢谢。

Edit: the file types in my case are ahk (auto hot key) files but i'm not sure it matter)编辑:我的文件类型是 ahk(自动热键)文件,但我不确定这很重要)

Edit 2: testing with a text file of 200KB I get the same issue编辑 2:使用 200KB 的文本文件进行测试我遇到了同样的问题

After doing quite a few tests I figured out that the file encoding was UTF-16LE as it is different than the file encoding type of Git (UTF-8) it was not displaying the changes made in the tools like Git Desktop or Source Tree.在做了很多测试之后,我发现文件编码是 UTF-16LE,因为它与 Git 的文件编码类型(UTF-8)不同,它没有显示在 Git Desktop 或 Source Tree 等工具中所做的更改。

Converting a file to UTF-8 and doing some change in it solved the issue for this file.将文件转换为 UTF-8 并对其进行一些更改解决了此文件的问题。

Leaving this here in case someone else have the same issue.留在这里以防其他人有同样的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM