ANSI color in git is not displayed correctly

前端 未结 8 1071
一向
一向 2020-12-12 18:00

Recently, I switched to SLES 11. I found a problem for git command. All the ANSI color could not be rendered. Instead, it shows the ANSI code like this:

*ESC

8条回答
  •  心在旅途
    2020-12-12 18:26

    For me, this did not work:

    git config --global core.pager less -R

    So instead i appended the following to my ~/.gitconfig file

     [core]
         pager = less -R
    

    To test it i did

    git log --graph --pretty=format:"%C(yellow)%h%Creset%C(blue)%d%Creset %C(white bold)%s%Creset %C(white dim)(by %an %ar)%Creset" --all

提交回复
热议问题