Coffee
Coffee

Reputation: 2223

Which command line should I use to get date of specific git commit?

So I have git hash (for example 123abc4 or full), what should I type in my terminal to get the date when this commit was published?

Upvotes: 0

Views: 39

Answers (1)

JDB
JDB

Reputation: 25820

git show 123abc4

git show will give you the date, author, description and file diffs.

As discovered by the OP, git log can output the date directly to the command line:

git log -1 123abc4 --format=%cd

If you don't want to use the stream pager (you want to print directly to the command line à la cat) then you can add --no-pager directly after the git command:

git --no-pager log --format=%cd -1 123abc4

Upvotes: 1

Related Questions