Git pretty format colors

前端 未结 5 735
醉酒成梦
醉酒成梦 2020-12-07 09:36

I\'m trying to set up pretty format colors for Git. From what I can tell version 1.6.0 only recognizes red, green and blue.

$ git log --pretty=format:\"%Cre         


        
5条回答
  •  天涯浪人
    2020-12-07 09:54

    I am using Ubuntu 18.04 and I was able to use Xiaofei HAN's suggestions.

    For beginner trying to complete this, I had the best luck by editing the .gitconfig.

    nano ~/.gitconfig
    

    paste [alias] block from above under the existing text

    CTRL + O (to write out) + CTRL + X (to close nano)

    After doing this, to see the pretty colors you can use

    git logs
    

    using

    'git log' will get you the view without the colors,

    same for 'git logs --oneline', except that one will show the flourish on the side

    thank you, i hope this helps someone

提交回复
热议问题