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),%cresetchange color of output , reset default color, respectively%hexpands abbreviated commit hash%dexpands list of references point commit%sexpands first line of commit message (i.e. "summary")
you can find complete list of placeholders in pretty formats section of
git logdocumentation.
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