在GitHub中,是否有一种简单的方法可以导航到大型开源项目的最早提交?

到目前为止,该项目已经提交了超过13000次。我不想在提交历史页面上无数次地按下“旧”按钮才能到达最初的提交(或第一次提交)。


当前回答

在项目页面单击选项卡Insights > contributor。 选择直方图的开头。 单击提交号。 完成了。

PS -画一个小范围得到一个单一的页面。

其他回答

没有明显的UI可以做到这一点,但是有一种方法可以构造正确的URL来访问提交日志的第一页。

假设我们想要找到dotnet/coreclr存储库的第一次提交。首先注意存储库中的提交数量:目前是16,634。现在转到提交列表,单击“Older”一次。URL类似于这样:https://github.com/dotnet/coreclr/commits/master?after=872095a758a3a6191a9798c94a98e8d1e16b2254+34

注意+34部分。这是跳过的提交数。把它改为16,634 - 1 - 35每页,这就得到了这个URL,它会把你带到coreclr提交历史的第一页。

需要使用git的git log——reverse命令。

这将以倒序(从最老的到最新的)返回指定回购的提交历史。

然后,在一些sed魔法的帮助下,您可以获得类似于第一次提交日期的信息(这是我自己一直需要的)。

git log --reverse | sed -n 3p

最后,您可能也想自动化这个操作(因为键入命令很无聊,或者根本不可能记住它),因此像这样的shell脚本可能会帮助您。

在项目页面单击选项卡Insights > contributor。 选择直方图的开头。 单击提交号。 完成了。

PS -画一个小范围得到一个单一的页面。

仅使用UI的另一个简单技巧是检查.gitignore或README文件的git历史记录。Md, 99%的情况下,你会很快发现第一次提交。

你可以使用init bookmarklet导航到GitHub存储库的第一次提交。

INIT A bookmarklet to quickly get you to the first commit of a repo. Overview Being able to quickly navigate to the oldest commit in a repo is quite helpful. Go ahead and drag the bookmarklet (link) onto your bookmark bar and click it whenever you'd like to go to the first commit of a repo. Usage Go to any particular repo's landing page (e.g. like the one you're on) and click the bookmarklet, which will take you to the first page (initial commit). By default, it tracks the master branch, but if you change the branch on the landing page, it will go to that branch's first commit. Retrieved from README.md on GitHub


免责声明:在发布这个答案前几分钟,我对init进行了一个小的自述更新。