【问题标题】:Git - How to get the first commit sha1 on a given dateGit - 如何在给定日期获得第一次提交 sha1
【发布时间】:2014-04-02 03:34:39
【问题描述】:

我想要给定日期的 00:00:01 小时之后的第一个 sha1,或者如果那天没有提交:该日期的 00:00:01 小时之前的最新提交号。

我只想要位于(合并到)trunk aka master 分支上的结果。

【问题讨论】:

    标签: git


    【解决方案1】:

    git rev-list -n1 --before="2014/2/27" master

    我在这里发现了这个命令:How can I get the diff between all the commits that occurred between two dates with Git?

    原来我真正想看到两个日期之间的差异,这个命令是那里的垫脚石,在上一个链接中找到了我的答案。

    【讨论】:

    • 对于那些懒得查-n是什么意思的人,使用-1
    猜你喜欢
    • 2017-04-14
    • 1970-01-01
    • 2014-10-23
    • 1970-01-01
    • 2013-08-26
    • 1970-01-01
    • 2011-04-18
    • 2016-03-14
    • 1970-01-01
    相关资源
    最近更新 更多