Why does git think each line of an untouched file has changed

后端 未结 1 1532
北恋
北恋 2020-12-18 04:46

I don\'t think it\'s a line ending difference issue - p4merge does not think anything has changed in the file, even when set to recognize line ending and white space differe

相关标签:
1条回答
  • 2020-12-18 05:16

    To show such "invisible" changes in details use:

    git diff --word-diff-regex=.
    

    This will mark all changed characters, even whitespace.

    Most probably it will show a change in line endings. If you are working on Windows and turned on core.autocrlf, git might expect the other kind of line ending and show the "wrong" line ending as diff.

    Telling git to not care about line endings by turning off core.autocrlf should fix your issue.

    0 讨论(0)
提交回复
热议问题