Andrew Paul Simmons
Andrew Paul Simmons

Reputation: 4523

How do I git log with short commit hash + date/time?

Let's say I do this command: git log -4 --pretty=format:%h

How do I add date/time to each result?

Upvotes: 6

Views: 8126

Answers (1)

Domain
Domain

Reputation: 11808

For Committer Date use %cd:

git log -4 --pretty=format:"%h - %cd"

-

For Author Date use %ad:

git log -4 --pretty=format:"%h - %ad"

-

For more options refer this.

Upvotes: 13

Related Questions