git log - Git log all, display current commit differently -
i tend use git log --all --graph --oneline
lot.
if current state behind last commit, find hardly on graph display.
is there way, conserving general display (oneline, graph), highlight current revision in way?
you can use --pretty
option of git log
include references (branches, tags , head
) in list of commits:
git log --all --graph --pretty='%c(green)%h%creset %c(cyan)%d%creset %s'
where:
%c(color)
,%creset
change color of output , reset default color, respectively%h
expands abbreviated commit hash%d
expands list of references point commit%s
expands first line of commit message (i.e. "summary")
you can find complete list of placeholders in pretty formats section of
git log
documentation.
of course, wouldn't want type every time want @ history, let's create alias it:
git config --global alias.lg \ "log --all --graph --pretty='%c(green)%h%creset %c(cyan)%d%creset %s'"
at point can git lg
.
alternatively, can specify default pretty format use git log
, git show
, git whatchanged
in format.pretty
configuration setting:
git config --global format.pretty '%c(green)%h%creset %c(cyan)%d%creset %s'
Comments
Post a Comment