I want to see the difference between old and new sources in git, but all files are displayed differently even though the contents are the same.

Asked 2 years ago, Updated 2 years ago, 53 views

There is a web server that is left unattended without an administrator, but it is currently working properly. I would like to use git to see the difference between the contents (new source) and the previous source (old source) stored locally.

I tried to do this, but the contents are exactly the same, but they are displayed differently, so all the files are judged not to be the same.
It is true that the timestamps are all different, but it takes a lot of time and effort to see the difference between the contents.Is there any good way?

I am not good at command systems, so I use tortoise Git.

git

2022-09-30 20:55

1 Answers

This may be because the new source and the old source have different line feed codes.
Try not to ignore line feed codes in the Differential Comparison tool.
A similar pattern could be the replacement of tab codes and half-width spaces.

It is also recommended that you consider introducing a EditorConfig mechanism to unify editor behavior by environment.Editors and IDEs in famous places are often supported.


2022-09-30 20:55

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.