Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How might one configure Git to highlight the Author for each commit in git log? Ideally, only the Author's name would be highlighted (red font), but if the only option is to highlight the entire line then that would work as well.

I notice that the commit line is highlighted with an orange font, which is why I suspect that this is possible to configure. However, I cannot find in the configuration files this option, nor could I find it with a google search.

share|improve this question
up vote 1 down vote accepted

You can do it with a pretty format git log command. This is roughly a plain git log with the author in red.

git log --pretty=format:"commit %C(yellow)%H%Creset%nAuthor: %Cred%an%Creset <%ae>%nDate: %ad%n%n%B%n"

The important bits are the %C(yellow)%H%Creset which is the commit highlight, and %Cred%an%Cresest which is author's name in red.

share|improve this answer
Thank you. However, this removes the highlight on the commit line! Where is this documented, so that I might adjust it as I see fit? – dotancohen May 19 '13 at 13:26
Do git help log and all the format commands are there. The commit line isn't highlighted on my system – parkydr May 19 '13 at 13:32
I've added the commit highlight, "orange" is actually yellow though it looks orange to me too – parkydr May 19 '13 at 13:44
Great, thanks!‏‏‏ – dotancohen May 19 '13 at 15:05
I am actually having a hard time massaging this to properly display multi-line comments. Right now they all appear on the same line. Do you have any idea what might be causing the issue? Thank you! – dotancohen May 29 '13 at 13:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .