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

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -