3

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

How do I add date/time to each result?

Andrew Paul Simmons
  • 3,783
  • 3
  • 26
  • 34
  • With Git 2.25 (Q1 2020), you also have [`git show -s --pretty=reference `](https://stackoverflow.com/a/59380120/6309) which can be of interest. – VonC Dec 17 '19 at 18:32

1 Answers1

12

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.

Domain
  • 11,110
  • 2
  • 22
  • 44