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.
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
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.
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
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.datedoes not touch machine-readable output. Pretty formats using%adhonor it;%aI,%atand%aialways keep their fixed format.log.date=format:...with%dis easily confused with the decoration placeholder when writing--format; the first example keeps them apart.log.decorate=autoavoids adding names when you pipe the output, so scripts parsing--onelinestay stable.mailmaponly changes display. Commits are not rewritten.%aNand%aEin formats are the mailmap-aware variants of%anand%ae.log.followonly 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);.mailmapis a file in the repository and is shared.
Related
git log,git show,git shortlog,diff.*,gpg.*- Lessons: Log and show, Revisions