Changing one character in a file leads to MSysGit thinking the whole file has changed

后端 未结 1 1408
耶瑟儿~
耶瑟儿~ 2021-01-14 01:45

I have a git repository containing C# code, and I\'m running MSysGit on Windows.

core.autocrlf is turned on, and I\'m using the .gita

相关标签:
1条回答
  • 2021-01-14 02:12

    A few things that can make Git show the entire file as changed:

    • Line endings -- but you said you checked these and they're the same;
    • Indentation -- VS (especially if you have some extensions installed) might change the indentation from tabs to spaces or vice-versa. You can check this with "Show Whitespace" (Ctrl-R, Ctrl-W in VS or the relevant option in your differ).
    • Encoding -- if VS decides to re-encode the file in some different encoding (e.g. UTF16) it might show up as entirely changed although the textual representation would look the same.
    0 讨论(0)
提交回复
热议问题