You should take a look at this post. It gives a very nice exemple of a customize git log. And also an oneliner to define it with a Git alias.

To try it, you can type:

git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit

To define it in an alias:

git config --global alias.lg "git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"

To use it :

git lg

To check your configuration:

git config alias.lg

To remove it:

git config --unset alias.lg

date=short

If you want to go further in the configuration, you should look at the Git pretty-formats documentation (placeholders section).

For the date you were talking about, you could change the %cr by %ad because this format respects the --date=option. So you could use --date=short as you want.


Tig

To finish there is a very powerful tool you could use if you are a command line lover like me: Tig

Answer from Nicolas Dupouy on Stack Overflow
🌐
Git
git-scm.com › docs › pretty-formats
Git - pretty-formats Documentation
This means that the final entry of a single-line format will be properly terminated with a new line, just as the "oneline" format does. For example: $ git log -2 --pretty=format:%h 4da45bef \ | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/' 4da45be 7134973 -- NO NEWLINE $ git log -2 ...
🌐
Devhints
devhints.io › git › git log format string cheatsheet
Git log format string cheatsheet
git log --pretty=format:%H · %H - Commit hash · %an - Author · � - Author date · One-page guide to Git log format string
🌐
Medium
jonelle-noelani.medium.com › git-pretty-9985da1f14ea
Git Pretty. I occasionally switch back and forth… | by Jonelle Noelani Yacapin | Medium
May 18, 2021 - --pretty=format: — this is how to access all those customizable pretty formatting placeholders; which will all be in a string i.e. will be between ‘ ‘ ... %s — subject; commit message (in the command above it’s not assigned a color ...
🌐
Git
git-scm.com › docs › git-log
Git - git-log Documentation
Pretty-print the contents of the commit logs in a given format, where <format> can be one of oneline, short, medium, full, fuller, reference, email, raw, format:<string> and tformat:<string>. When <format> is none of the above, and has %<placeholder> in it, it acts as if --pretty=tformat:<format> ...
🌐
Coderwall
coderwall.com › p › euwpig › a-better-git-log
A better git log (Example)
December 10, 2025 - git config --global alias.lg-ascii "log --graph --pretty=format:'%h -%d %s (%cr) <%an>' --abbrev-commit"
🌐
Git
git-scm.com › docs › pretty-options
Git - pretty-options Documentation
Pretty-print the contents of the commit logs in a given format, where <format> can be one of oneline, short, medium, full, fuller, reference, email, raw, format:<string> and tformat:<string>. When <format> is none of the above, and has %<placeholder> in it, it acts as if --pretty=tformat:<format> ...
Find elsewhere
🌐
Edureka
edureka.co › blog › git-format-commit-history
Git log format history | Use Git log to format the commit history | Edureka
September 14, 2024 - Command: git log --pretty=raw The raw log output format shows the entire commit exactly as stored in the commit object.
Top answer
1 of 4
12

git show --format="YOUR_FORMAT" -s

-s suppresses the diffs from showing.

YOUR_FORMAT is documented at:

man git-log

section PRETTY FORMATS

For example, to get just commit SHAs and author email for a few SHAs:

git show --format="%H %ae" -s 62f6870e4e0b384c4bd2d514116247e81b241251 96ee0246ce52012644dd18cf360e64c49016fb7f

gives output for format:

62f6870e4e0b384c4bd2d514116247e81b241251 [email protected]
96ee0246ce52012644dd18cf360e64c49016fb7f [email protected]

To add newlines and more fields to the format, you could do:

git show --format=$'%H\n%ae\n%an\n' -s 62f6870e4e0b384c4bd2d514116247e81b241251 96ee0246ce52012644dd18cf360e64c49016fb7f

Which gives output for form:

62f6870e4e0b384c4bd2d514116247e81b241251
[email protected]
Ciro Santilli

96ee0246ce52012644dd18cf360e64c49016fb7f
[email protected]
Ciro Santilli
2 of 4
5

Im using this script (as alias):

https://github.com/vheon/home/blob/master/.githelpers

git alias:

l = "!bash -c 'source ~/.githelpers && pretty_git_log'"

the output is this:


You will have to use your own git log --pretty=format options.

In the --pretty you can set colors and choose any content you would like to display


format:<string>

The format: format allows you to specify which information you want to show. It works a little bit like printf format, with the notable exception that you get a newline with %n instead of \n.

E.g, format:The author of %h was %an, %ar%nThe title was >>%s<<%n would show something like this:

The author of fe6e0ee was Junio C Hamano, 23 hours ago
The title was >>t4119: test autocomputing -p<n> for traditional diff input.<<

The placeholders are:

%C(…): color specification, as described in color.branch.* config option; adding auto, at the beginning will emit color only when colors are enabled for log output (by color.diff, color.ui, or --color, and respecting the auto settings of the former if we are going to a terminal). auto alone (i.e. %C(auto)) will turn on auto coloring on the next placeholders until the color is switched again.

%C(…): color specification, as described in color.branch.* config option; adding auto, at the beginning will emit color only when colors are enabled for log output (by color.diff, color.ui, or --color, and respecting the auto settings of the former if we are going to a terminal). auto alone (i.e. %C(auto)) will turn on auto coloring on the next placeholders until the color is switched again.

%Cblue: switch color to blue
%Cgreen: switch color to green
%Cred: switch color to red
%Creset: reset color
%D: ref names without the " (", ")" wrapping.
%G?: show "G" for a Good signature, "B" for a Bad signature, "U" for a good, untrusted signature and "N" for no signature
%GG: raw verification message from GPG for a signed commit
%GK: show the key used to sign a signed commit
%GS: show the name of the signer for a signed commit
%H: commit hash
%N: commit notes
%P: parent hashes
%T: tree hash
%aD: author date, RFC2822 style
%aE: author email (respecting .mailmap, see git-shortlog(1) or git-blame(1))
%aI: author date, strict ISO 8601 format
%aN: author name (respecting .mailmap, see git-shortlog(1) or git-blame(1))
%ad: author date (format respects --date= option)
%ae: author email
%ai: author date, ISO 8601-like format
%an: author name
%ar: author date, relative
%at: author date, UNIX timestamp
%b: body
%cD: committer date, RFC2822 style
%cE: committer email (respecting .mailmap, see git-shortlog(1) or git-blame(1))
%cI: committer date, strict ISO 8601 format
%cN: committer name (respecting .mailmap, see git-shortlog(1) or git-blame(1))
%cd: committer date (format respects --date= option)
%ce: committer email
%ci: committer date, ISO 8601-like format
%cn: committer name
%cr: committer date, relative
%ct: committer date, UNIX timestamp
%d: ref names, like the --decorate option of git-log(1)
%e: encoding
%f: sanitized subject line, suitable for a filename
%gD: reflog selector, e.g., refs/stash@{1}
%gE: reflog identity email (respecting .mailmap, see git-shortlog(1) or git-blame(1))
%gN: reflog identity name (respecting .mailmap, see git-shortlog(1) or git-blame(1))
%gd: shortened reflog selector, e.g., stash@{1}
%ge: reflog identity email
%gn: reflog identity name
%gs: reflog subject
%h: abbreviated commit hash
%m: left, right or boundary mark
%n: newline
%p: abbreviated parent hashes
%s: subject
%t: abbreviated tree hash
%w([<w>[,<i1>[,<i2>]]]): switch line wrapping, like the -w option of git-shortlog(1).
%x00: print a byte from a hex code

🌐
egghead.io
egghead.io › lessons › git-make-my-git-log-look-pretty-and-readable
Make my git log look pretty and readable | egghead.io
However, the build-in git log output format is not really suitable for everyday usage. In this lesson we will create a dedicated git alias lg which will printout a nicely formatted git log list. ... lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --branches
Published   October 12, 2018
🌐
Gitimmersion
gitimmersion.com › lab_10.html
Lab 10 - Git Immersion
git log --all --pretty=format:'%h � %s (%an)' --since='7 days ago'
🌐
Alchemists
alchemists.io › screencasts › git_log_pretty
Git Log Pretty | Alchemists
March 15, 2020 - `(yellow)`). # Colors must be reset ... hash of 12 characters works best while still unique: git config --get core.abbrev # Next is `%G?` for signed commits, printed in white color: git log --pretty=format:"%G?" # The output of "N" means each commit has no signature....
🌐
ttias.be
ma.ttias.be › pretty-git-log-in-one-line
Pretty git log in one line
August 25, 2015 - $ git log --pretty=oneline 3396763626316124388f76be662bd941df591118 Add twitter link c73bbc98b5f55e5a4dbfee8e0297e4e1652a0687 add facebook link
🌐
Atlassian
atlassian.com › git › tutorials › git-log
Advanced Git Log | Atlassian Git Tutorial
January 12, 2026 - 1git log --pretty=format:"%cn committed %h on �" This results in the following format for each commit: 1John committed 400e4b7 on Fri Jun 24 12:30:04 2014 -0500 John committed 89ab2cf on Thu Jun 23 17:09:42 2014 -0500 Mary committed 180e223 on Wed Jun 22 17:21:19 2014 -0500 John committed f12ca28 on Wed Jun 22 13:50:31 2014 -0500 · The complete list of placeholders can be found in the Pretty Formats section of the git log manual page.
Top answer
1 of 16
1220
git log --pretty=format:"%h%x09%an%x09%ad%x09%s"

does the job. This outputs:

  fbc3503 mads    Thu Dec 4 07:43:27 2008 +0000   show mobile if phone is null...
  ec36490 jesper  Wed Nov 26 05:41:37 2008 +0000  Cleanup after [942]: Using timezon
  ae62afd tobias  Tue Nov 25 21:42:55 2008 +0000  Fixed #67 by adding time zone supp
  164be7e mads    Tue Nov 25 19:56:43 2008 +0000  fixed tests, and a 'unending appoi
  93f1526 jesper  Tue Nov 25 09:45:56 2008 +0000  adding time.ZONE.now as time zone
  2f0f8c1 tobias  Tue Nov 25 03:07:02 2008 +0000  Timezone configured in environment
  a33c1dc jesper  Tue Nov 25 01:26:18 2008 +0000  updated to most recent will_pagina

It was inspired by Stack Overflow question: "Git log output like 'svn ls -v'". I found out that I could add the exact parameters I needed.

To shorten the date (not showing the time), use --date=short.

In case you were curious what the different options were:

  • %h = abbreviated commit hash
  • %x09 = tab (character for code 9)
  • %an = author name
  • %ad = author date (format respects --date= option)
  • %s = subject

It is from git-log(1) Manual Page (PRETTY FORMATS section) by the comment of Vivek.

2 of 16
294

I use these two .gitconfig file settings:

[log]
  date = relative
[format]
  pretty = format:%h %Cblue%ad%Creset %ae %Cgreen%s%Creset

%ad is the author date, which can be overridden by --date or the option specified in the [log] stanza in .gitconfig. I like the relative date, because it gives an immediate feeling of when stuff was committed. The output looks like this:

6c3e1a2 2 hours ago [email protected] lsof is a dependency now.
0754f18 11 hours ago [email protected] Properly unmount, so detaching works.
336a3ac 13 hours ago [email protected] Show ami registration command if auto register fails
be2ad45 17 hours ago [email protected] Fixes #6. Sao Paolo region is included as well.
5aed68e 17 hours ago [email protected] Shorten while loops

This is all of course in color, so it is easy to distinguish the various parts of a log line. Also it is the default when typing git log because of the [format] section.

Since Git now supports padding, I have a nice amendment to the version above:

pretty = format:%C(yellow)%h %Cblue%>(12)%ad %Cgreen%<(7)%aN%Cred%d %Creset%s

This right aligns the relative dates and left aligns committer names, meaning you get a column-like look that is easy on the eyes.

Screenshot

Since GPG commit signing is becoming a thing, here is a version that includes signature verification (in the screenshot it's the magenta letter right after the commit). A short explanation of the flag:

%G?: show "G" for a good (valid) signature, "B" for a bad signature, "U" for a good signature with unknown validity and "N" for no signature

Other changes include:

  • colors are now removed if the output is to something other than the tty (which is useful for grepping, etc.)
  • git log -g now contains the reflog selector.
  • Save two parentheses on refnames and put them at the end (to preserve column alignment)
  • Truncate relative dates if they are too long (e.g., 3 years, 4..)
  • Truncate committer names (it might be a little short for some people, but just change the %<(7,trunc) or check out the Git .mailmap feature to shorten committer names)

Here's the configuration:

pretty = format:%C(auto,yellow)%h%C(auto,magenta)% G? %C(auto,blue)%>(12,trunc)%ad %C(auto,green)%<(7,trunc)%aN%C(auto,reset)%s%C(auto,red)% gD% D

All in all column alignment is now preserved a lot better at the expense of some (hopefully) useless characters.

I'd love to make the message color depend on whether a commit is signed, but it doesn't seem like that is possible at the moment.

Screenshot

🌐
DEV Community
dev.to › pradumnasaraf › beautify-your-git-log-with-a-single-command-2i5
Beautify Your Git Log with a Single Command - DEV Community
August 6, 2023 - A terse variant is: git log --oneline --graph -n11 My fancy variants I've been using for years: [alias] log2 = log -n2 --graph --pretty=format:'%C(auto,yellow)%h %C(auto,blue)%>(18,trunc)� %C(auto,green)%<(12,trunc)%aN %C(auto,reset)%s%C(auto,red)% gD% D' log9 = log -n9 --graph --pretty=format:'%C(auto,yellow)%h %C(auto,blue)%>(18,trunc)� %C(auto,green)%<(12,trunc)%aN %C(auto,reset)%s%C(auto,red)% gD% D' log11 = log -n11 --graph --pretty=format:'%C(auto,yellow)%h %C(auto,blue)%>(18,trunc)� %C(auto,green)%<(12,trunc)%aN %C(auto,reset)%s%C(auto,red)% gD% D'