Git Log Format Cheat Sheet

From WikiOD

Here is the cheatsheat of Git Log Format and basic guide on how to use Git Log Format

Log format[edit | edit source]

{: .-three-column}

Pretty format[edit | edit source]

{: .-prime}

git log --pretty="format:%H"

See the next tables on format variables.

Hash[edit | edit source]

Commit[edit | edit source]

Variable Description
%H commit hash
%h (abbrev) commit hash

Tree[edit | edit source]

Variable Description
%T tree hash
%t (abbrev) tree hash

Parent[edit | edit source]

Variable Description
%P parent hash
%p (abbrev) parent hash

Commit[edit | edit source]

Variable Description
%s commit subject
%f commit subject, filename style
%b commit body
%d ref names
%e encoding

Author and committer[edit | edit source]

Author[edit | edit source]

Name[edit | edit source]

Variable Description
%an author
%aN author, respecting mailmap

Email[edit | edit source]

Variable Description
%ae author email
%aE author email, respecting mailmap

Date[edit | edit source]

Variable Description
%aD author date (rfc2882)
%ar author date (relative)
%at author date (unix timestamp)
%ai author date (iso8601)

Committer[edit | edit source]

Name[edit | edit source]

Variable Description
%cn committer name
%cN committer name, respecting mailmap

Email[edit | edit source]

Variable Description
%ce committer email
%cE committer email, respecting mailmap

Date[edit | edit source]

Variable Description
%cD committer date (rfc2882)
%cr committer date (relative)
%ct committer date (unix timestamp)
%ci committer date (iso8601)

Also see[edit | edit source]

  • [[./git-log|Git log cheatsheet]]

Credit:rstacruz