2

I find the default pretty format to verbose, so I have made i more concise version with:

[format]
    pretty = %C(yellow)commit:   %h%Creset%C(auto)%d%C(reset)%nauthor:   %an <%ae>%ndate:     %ad%nsummary:  %s%n

which produces something like:

commit:   ab6cdf4 (HEAD -> master, tag: v1.1)
author:   author name <author@email.com>
date:     Fri Nov 15 22:00:00 2019 +0100
summary:  A very nice commit title

with the first line coloured a lot like usual.

However, this does not only affect git log but also git show, and for git show I would actually rather use the medium or fuller formats.

Is there any way of setting the format for git log only? Maybe through another option than format.pretty.

An obvious solution is to make an alias for a version of log or show using the other format, but I would rather avoid that, if possible.

Kristian
  • 1,667
  • 2
  • 15
  • 20

1 Answers1

1

Considering git config format.pretty is always for git log (configuration) and git show, I have always defined an alias for git log.

For instance:

So an alias in this case might still be the current recommended workaround.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250