12

In Git, there are 2 types of dates: author-date and commit-date.

git log shows the author date by default. Similarly, GitHub desktop appears to show the author-date by default. However, GitHub.com shows the commit-date by default.

So far, I was unable to find how to view the author-date for a commit on the GitHub.com website. Although this answer described how to view it in the GitHub API, I didn't find anything on how to view it on the website itself.

Is there any way to view the author-date either on the general commit log page or at the individual commit level?

1

1 Answer 1

8

Since the author-date is part of the patch format, you can get it from appending .patch while viewing a commit on the GitHub website:

https://github.com/<owner>/<repo>/commit/<commit-sha>.patch 

The Date field in the output is what you are searching for:

From dc382172d6824a8f01d36904afefe8d5d3e9c0b7 Mon Sep 17 00:00:00 2001 From: [...] <[...]> Date: Sun, 12 Mar 2022 11:50:32 +0100 Subject: [PATCH] [...] --- [...] 
Sign up to request clarification or add additional context in comments.

2 Comments

There should have been a simpler way, but for now I am afraid that in order to get a better solution we will have to develop a browser extension or bookmarklet
I wrote a very short JavaScript command that automatically adds the author date to a commit page, which you can use with something like a bookmarklet or ViolentMonkey: fetch(location.href.split("#")[0] + ".patch").then(x => x.text()).then(x => document.querySelector(".CommitAttribution-module__CommitAttributionContainer--dZiJ_ > relative-time").after("; Author" + x.split("\n")[2]))

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.