1

My developer just made some commits, I tried to compare his last commit with one previous commit, and here is the result:

enter image description here

I just don't understand why GitHub marks many files changed, whereas actually their body did not change. latest-website/.gitignore, latest-website/README.md, etc. were all like that.

Does anyone know why?

2
  • Did the text editor your developer use alter the line breaks or convert between tabs and spaces? Jul 6, 2020 at 23:03
  • I don't think so...
    – SoftTimur
    Jul 6, 2020 at 23:06

1 Answer 1

1

It's hard telling without doing a git diff to see what it may be.

The two most common I have come across are the following.

  1. Due to the change in line endings. They may have changed from CRLF (Windows) to LF (Unix) or vice versa.

To better handle this option you can do git config core.autocrlf input

  1. Doing a git diff shows old mode and new mode have different file permissions for each file. For example 777 given to all of the local files whereas the repo has 755.

As Mike said in a comment, sometimes I'll see a change from tabs to spaces or 2 space vs 4 space. To combat that issue, we have a .editorconfig file.

1
  • git diff ea9ee9b7254f9293bd57dc15c651474c383cb584..f0f05f42a5822a1e28f68ca83a72b51ed0505a21 -- latest-website/README.md does show many ^M in the later version. I guess it is because the files were transformed in his Windows.
    – SoftTimur
    Jul 6, 2020 at 23:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .