Skip to content
Tutorials Center
My learning

Topics

Git Reference ยท Configuration Options

log.* settings

Reference for log.* settings: log.date, log.decorate, log.abbrevCommit, log.mailmap, log.follow, log.showSignature and log.showRoot, with examples.

The log.* settings supply default options for git log, so you do not have to type --date=short or --decorate each time. They also apply to git show and git whatchanged where noted. Anything you pass on the command line wins over the configuration.

Terminal
git config --global log.date short
git config --global log.decorate auto
git config --global log.mailmap true
git config --global log.abbrevCommit true

Try it

Bash Date formats and abbreviated commits

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with read or cat), it gets the next line from this box.

Bash Decorate and mailmap

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with read or cat), it gets the next line from this box.

Syntax

Terminal
git config log.date <format>
git config log.decorate (auto | short | full | no)
git config log.abbrevCommit (true | false)
git config log.mailmap (true | false)
git config log.follow (true | false)
git config log.showRoot (true | false)
git config log.showSignature (true | false)
git config log.excludeDecoration <pattern>
git config log.graphColors <colors>
Name Description
log.date Default for --date: default, relative, local, short, iso, iso-strict, rfc, human, raw, unix or format:<strftime>.
log.decorate Show ref names next to commits. auto (default for terminals) means short names only when output goes to a terminal.
log.abbrevCommit Same as --abbrev-commit: print shortened hashes in the standard format.
log.mailmap Apply .mailmap author rewriting in git log, show and whatchanged. Default true in recent Git versions.
log.follow When logging a single file, follow it across renames (like --follow).
log.showRoot Show the root commit as a full diff (default true). Used by git show and git whatchanged.
log.showSignature Verify and print GPG or SSH signatures for each commit, like --show-signature.
log.excludeDecoration Hide refs matching a glob from decorations (repeatable).
log.graphColors Comma-separated colors for --graph lines.

Errors: an unrecognized log.date value fails with fatal: unknown date format. log.showSignature=true without a working gpg prints errors for every commit.

Usage notes

  • log.date does not touch machine-readable output. Pretty formats using %ad honor it; %aI, %at and %ai always keep their fixed format.
  • log.date=format:... with %d is easily confused with the decoration placeholder when writing --format; the first example keeps them apart.
  • log.decorate=auto avoids adding names when you pipe the output, so scripts parsing --oneline stay stable.
  • mailmap only changes display. Commits are not rewritten. %aN and %aE in formats are the mailmap-aware variants of %an and %ae.
  • log.follow only works with exactly one path and slows down on very long histories.
  • Cost of showSignature: each commit starts a verification process, so enable it per command (git log --show-signature) rather than globally on big repositories.
  • Per-user versus per-repo: date and decorate are personal preferences (--global); .mailmap is a file in the repository and is shared.