1

Before staging the change

enter image description here

After staging the change

enter image description here

This strange issue causes me big trouble on saving the changes. Git thus always displays everything changed.

I tried to remove and create a new branch, but it doesn't work. I also tried the ans from: Stackoverflow question: diff returning entire file for identical files. (Though I am quite sure I didn't use unix to edit this file.) However, the same situation still occurs.

Any suggestion to fix it?

Navneet Krishna
  • 5,009
  • 5
  • 25
  • 44
MT-FreeHK
  • 2,462
  • 1
  • 13
  • 29
  • This looks like an encoding problem. Are you using a plain text editor, or is it possible that you pasted some UTF-8 rich text and saved it? – Tim Biegeleisen Oct 13 '17 at 03:43
  • @TimBiegeleisen I just use VScode to edit it, with Gitlen. After ur question, I tried to copy and paste all text to another file, and another file don't show the same problem. So now I just use that 'another file' to substitute this one. However, I am still curious how to solve this, as there may still be other files sharing the same situation, I probably dun want to repeatedly create and replace old file. Thx – MT-FreeHK Oct 13 '17 at 04:05
  • Are these just JS files? When you save, is there an encoding option? – Tim Biegeleisen Oct 13 '17 at 04:09
  • @TimBiegeleisen Just JS files, I dun have any encoding option when I saved. Probably some setting in Git makes this error? Please let me know if I can read those setting somewhere. – MT-FreeHK Oct 13 '17 at 04:41

0 Answers0