DEV Community

Lam
Lam

Posted on

2 2

Git Log Format String Cheat Sheet

Also see

[Author and committer] Committer

Name

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

Email

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

Date

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

[Author and committer] Author

Name

Variable Description
%an author
%aN author, respecting mailmap

Email

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

Date

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

[Log format] Commit

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

[Log format] Hash

Commit

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

Tree

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

Parent

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

[Log format] Pretty format

git log --pretty="format:%H"
Enter fullscreen mode Exit fullscreen mode

See the next tables on format variables.

Image of Datadog

How to Diagram Your Cloud Architecture

Cloud architecture diagrams provide critical visibility into the resources in your environment and how they’re connected. In our latest eBook, AWS Solution Architects Jason Mimick and James Wenzel walk through best practices on how to build effective and professional diagrams.

Download the Free eBook

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay