0

I am new to using git, and when I use the diff command to see the changes I git something a little different on my screen....

ESC[1mdiff --git a/first_file.txt b/first_file.txtESC[m
ESC[1mindex f49d459..3748de6 100644ESC[m
ESC[1m--- a/first_file.txtESC[m
ESC[1m+++ b/first_file.txtESC[m
ESC[36m@@ -1 +1,2 @@ESC[m
ESC[31m-This is the  first fileESC[m
ESC[32m+ESC[mESC[32mThis is the  first file added to my projectESC[m
ESC[41m+ESC[m

I am not sure what the "ESC" and the numbers like "1m, 36m" is supposed to mean... Does anyone might know why this is showing?

Any help would be really appreciated!

Eldan Shkolnikov
  • 441
  • 1
  • 6
  • 13
  • 1
    Try disabling color: `git diff --no-color`. – Amber Dec 01 '14 at 03:44
  • related question: [When I saved in Windows 7, git diff shows all the lines with ^M](http://stackoverflow.com/questions/6081455/when-i-saved-in-windows-7-git-diff-shows-all-the-lines-with-m) – Saullo G. P. Castro Sep 04 '15 at 17:02

2 Answers2

3

Never mind guys.. After doing some research I ran the following command and it works perfectly fine!

export LESS=-R\ $LESS
Eldan Shkolnikov
  • 441
  • 1
  • 6
  • 13
0

That's ANSI escape code, commonly used in telnet services for coloring. This means the CLI tool you're using may not support ANSI escape code.

Leo
  • 13,428
  • 5
  • 43
  • 61