What is the meaning of ^M in 'git diff'? What is the meaning of ^M in 'git diff'? git git

What is the meaning of ^M in 'git diff'?


^M represents carriage return. This diff means something removed a Unicode BOM from the beginning of the line and added a CR at the end.

The ^ symbol stands for Control, so ^M means Ctrl+M.

To get from that to the actual ASCII character code, you take the base character and flip bit 6 (i.e. XOR with 64). For letters, that just means subtract 64. So e.g. ^A is character code 1 (because A is 65). ^M is 77 - 64 = 13 (because M is 77), which corresponds to carriage return in ASCII.