Git log formats

By on

Given a repository with a single commit:

git init
touch "file.txt"
git add file.txt
git commit -m "Subject" -m "First paragraph" -m "Second paragraph"

git log --format=medium

The “medium” format is the default when passing no --format option:

git log
commit f142f6d3327fbc17ff3f9a7f6c4157d70da7083f
Author: Alice <alice@example.com>
Date:   Thu Jul 22 07:45:25 2021 +0200

    Subject

    First paragraph

    Second paragraph

git log --format=oneline

git log --format=oneline
f142f6d3327fbc17ff3f9a7f6c4157d70da7083f Subject

git log --format=short

git log --format=short
commit f142f6d3327fbc17ff3f9a7f6c4157d70da7083f
Author: Alice <alice@example.com>

    Subject

git log --format=full

git log --format=full
commit f142f6d3327fbc17ff3f9a7f6c4157d70da7083f
Author: Alice <alice@example.com>
Commit: Bob <bob@example.com>

    Subject

    First paragraph

    Second paragraph

git log --format=fuller

git log --format=fuller
commit f142f6d3327fbc17ff3f9a7f6c4157d70da7083f
Author:     Alice <alice@example.com>
AuthorDate: Thu Jul 22 07:45:25 2021 +0200
Commit:     Bob <bob@example.com>
CommitDate: Thu Jul 22 07:45:25 2021 +0200

    Subject

    First paragraph

    Second paragraph

git log --format=email

git log --format=email
From f142f6d3327fbc17ff3f9a7f6c4157d70da7083f Mon Sep 17 00:00:00 2001
From: Alice <alice@example.com>
Date: Thu, 22 Jul 2021 07:45:25 +0200
Subject: [PATCH] Subject

First paragraph

Second paragraph

git log --format=raw

git log --format=raw
commit f142f6d3327fbc17ff3f9a7f6c4157d70da7083f
tree bdd68b0120ca91384c1606468b4ca81b8f67c728
author Alice <alice@example.com> 1626932725 +0200
committer Bob <bob@example.com> 1626932725 +0200

    Subject

    First paragraph

    Second paragraph