Git diff showing horrible escape characters

Funny little one this…

When running a git diff command I was getting horrible escape characters everywhere.  Turns out this is because my terminal was in colour mode – (set up by the server admin) – and this was causing the escape characters.

Simply ran the git diff command with the –no-color option to get the output back to a nice normal diff output.

Share Post :


  • Judit
    17th July 2014 at 1:29 pm http://a%20rel='nofollow'%20class='comment-reply-link'%20href='#comment-1097'%20onclick='return%20addComment.moveForm(%20comment-1097,%201097,%20respond,%202281%20)'%20aria-label='Reply%20to%20Judit'%20-%20Reply/a

    This command worked for me in several machines:
    ‘export LESS=-R $LESS’

    It will display git diff in colours without strange characters =)

  • Ali
    18th February 2015 at 8:27 am http://a%20rel='nofollow'%20class='comment-reply-link'%20href='#comment-1098'%20onclick='return%20addComment.moveForm(%20comment-1098,%201098,%20respond,%202281%20)'%20aria-label='Reply%20to%20Ali'%20-%20Reply/a


    Worked for me on a tcsh shell.

    setenv LESS -R

  • Dan Farrell
    24th January 2018 at 1:35 am http://a%20rel='nofollow'%20class='comment-reply-link'%20href='#comment-3707'%20onclick='return%20addComment.moveForm(%20comment-3707,%203707,%20respond,%202281%20)'%20aria-label='Reply%20to%20Dan%20Farrell'%20-%20Reply/a

    Awesome, thanks. Seems as tough some “less” functionality, maybe busybox, was being used in my case (alpine). An install of `less` took care of the problem for me.

Leave a Reply