Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

git

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

How do I add date/time to each result?

like image 905
Andrew Paul Simmons Avatar asked Sep 02 '26 12:09

Andrew Paul Simmons


1 Answers

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.

like image 68
Domain Avatar answered Sep 05 '26 03:09

Domain