git log formatting

后端 未结 4 1473
不思量自难忘°
不思量自难忘° 2021-01-30 23:52

I need to have format like:

git log --decorate --graph --oneline --date-order

but I need it also:

  1. to contain date (short)
4条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-31 00:22

    You can try:

    alias.lgb=log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=short --branches
    

    It has different color, but you can change them easily.

    for instance:

    git log --graph --pretty=format:'%Cred%h -%d %s (%cr) <%an>%Creset' --abbrev-commit --date=short --branches
    

提交回复
热议问题