diff returning entire file for identical files

心已入冬 提交于 2019-11-27 08:35:01

This seems like a whitespace issue, in order to avoid them in the future, you can setup Git to normalize them.

Windows and UNIX system don't use same line-ending, to prevent conflict from happening based on these, you should setup you git config this way:

  • Windows : git config --global core.autocrlf true
  • Unix : git config --global core.autocrlf input

Next, to make sure we only commit with ideal whitespace rules, you can set this config option:

git config --global core.whitespace trailing-space,space-before-tab,indent-with-non-tab

Most likely it's line termination. Try git diff --ignore-space-at-eol. And for plain (not git) diff it's diff -b.

That usually means the line endings are different. Most diffin programs allow you to ignore differences in line endings. Does yours allow you to do so?

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!