在GitHub中,是否有一种简单的方法可以导航到大型开源项目的最早提交?
到目前为止,该项目已经提交了超过13000次。我不想在提交历史页面上无数次地按下“旧”按钮才能到达最初的提交(或第一次提交)。
在GitHub中,是否有一种简单的方法可以导航到大型开源项目的最早提交?
到目前为止,该项目已经提交了超过13000次。我不想在提交历史页面上无数次地按下“旧”按钮才能到达最初的提交(或第一次提交)。
当前回答
你可以使用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进行了一个小的自述更新。
其他回答
我想看看nodejs项目最早的一次提交。我已经做到了以下几点。
访问站点nodejs。然后观察到,此时提交的总数约为233,000次(准确地说是23652次)。
接下来,我点击了提交链接,将我带到https://github.com/nodejs/node/commits/master,如下所示。
现在向下滚动到底部,我找到了“更新”和“旧”按钮。“更新”按钮被禁用。我点击了旧的按钮,它把我带到了https://github.com/nodejs/node/commits/master?after=de37ba34c5d6f3a2d18daf482f850be8fddb4621+34 现在可以看到url有+34。现在我将其更改为23000(因为我观察到的提交数量是23000)。我尝试的新网址是
https://github.com/nodejs/node/commits/master?after=de37ba34c5d6f3a2d18daf482f850be8fddb4621+23000
现在我快到了。通过更多的迭代或旧的按钮点击,我达到了我想要的地方。
克隆存储库,用命令行打开并运行$ git log——reverse
这将以相反的顺序显示提交。
一旦你有了第一次提交的ID(对象名),你就可以在github上查看它了…之类的……https://github.com/UserName/Repo/commit/6a5ace7b941120db5d2d50af6321770ddad4779e
在项目页面单击选项卡Insights > contributor。 选择直方图的开头。 单击提交号。 完成了。
PS -画一个小范围得到一个单一的页面。
仅使用UI的另一个简单技巧是检查.gitignore或README文件的git历史记录。Md, 99%的情况下,你会很快发现第一次提交。
需要使用git的git log——reverse命令。
这将以倒序(从最老的到最新的)返回指定回购的提交历史。
然后,在一些sed魔法的帮助下,您可以获得类似于第一次提交日期的信息(这是我自己一直需要的)。
git log --reverse | sed -n 3p
最后,您可能也想自动化这个操作(因为键入命令很无聊,或者根本不可能记住它),因此像这样的shell脚本可能会帮助您。