如何在Github上看到一个存储库项目的创builddate?

我知道这是一个基本的问题,但我找不到一个办法来实现它。 我想知道如何知道在Github上创build一个项目的date。 我有时会比较两个类似的项目,以便select一个将包含在我自己的项目中的项目,创builddate也是有趣的考虑因素。 基本上,我必须find第一个提交看到创build的date,但是,有些项目有500个提交,这浪费了我很多时间来更改页面,直到到达第一个提交页面。

有没有更好的方式来获得创build的date?

如何知道在Github上创build项目的date。

使用Repos GitHub Api来检索这些信息

  • 语法https://api.github.com/repos/{:owner}/{:repository}https://api.github.com/repos/{:owner}/{:repository} : https://api.github.com/repos/{:owner}/{:repository} : https://api.github.com/repos/{:owner}/{:repository}
  • 例如: https://api.github.com/repos/libgit2/libgit2sharp https://api.github.com/repos/libgit2/libgit2sharp

JSON有效负载将公开创build存储库的UTCdate的created_at成员。

考虑到上面的LibGit2Sharp存储库,可以看到它是在2011年2月2日16:44:49 UTC创build的。

注意: created_at不一定会反映第一次提交的date。 这是版本库在GitHub上创build的date。 例如, xunit/resharper-xunit项目最近从codeplex转移到了GitHubcreated_atdate是2014-05-01T11:17:56Z ,但是大部分提交的date比这更远。

@ nulltoken的答案是非常有用的。 为了使它更方便,我决定创build一个扩展名来显示一个库的创builddate。

强调

  • 资源库页面上汇总栏中美丽的日历图标
  • 可定制的date格式遵循矩matrix格式
  • 通过将所有提取的URI存储在存储器中来获得最佳性能

存储库的创builddate显示在摘要栏上:

landpage

date格式可通过点击扩展图标进行定制:

选项

这对我来说真的很好。 我希望它也对你有用。

您也可以使用Github的新GraphQL API :

 query { repository(owner: "graphql", name: "graphql-js") { name createdAt } } 

我创build了一个用户脚本,直接在repo的GitHub页面上显示创builddate: https : //openuserjs.org/scripts/cosenal/GitHub_Repo_Dates

句法:

 curl -s https://api.github.com/repos/{:owner}/{:repository} | jq '.created_at' 

例:

 curl -s https://api.github.com/repos/NabiKAZ/video2gif | jq '.created_at' 

结果:

 "2017-04-22T22:58:47Z"