Git pretty format colors

前端 未结 5 730
醉酒成梦
醉酒成梦 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:42

    Share my git log format:

    $ git log --graph --pretty=format:'%C(magenta)%h%Creset -%C(red)%d%Creset %s %C(dim green)(%cr) %C(cyan)<%an>%Creset' --abbrev-commit
    

    You can also add an alias into ~/.gitconfig:

    [alias]
        logs  = log --graph --pretty=format:'%C(magenta)%h%Creset -%C(red)%d%Creset %s %C(dim green)(%cr) %C(cyan)<%an>%Creset' --abbrev-commit
    

    then you can use alias as you define in ~/.gitconfig.

    $ git logs
    

提交回复
热议问题