0

I'll sometimes edit a line using my IDE (NuSphere's PhpED), and then return it to what I think is the original. git diff, however, shows it as being changed with the only difference being a ^M at the end. What does ^M signify? Anything I could do to edit the code so it doesn't show up as a change?

- <td></td>
- <td><img […]></td>
+ <td></td>^M
+ <td><img […]></td> ^M
Richard
  • 106,783
  • 21
  • 203
  • 265
user1032531
  • 24,767
  • 68
  • 217
  • 387

2 Answers2

4

Something changed your line endings from Unix style to Windows. The ^M is a carriage return character. Check all your tools settings carefully!

Carl Norum
  • 219,201
  • 40
  • 422
  • 469
2

^M is one of the multiple representations of the carriage return character.

It is a white space character, it does not usually affect the code and the HTML.

It presence in your file is a sign that the file was edited/saved on a Windows system.

axiac
  • 68,258
  • 9
  • 99
  • 134