【问题标题】:git log <since> <until> shows all log instead of specifiedgit log <since> <until> 显示所有日志而不是指定的
【发布时间】:2012-04-11 10:09:13
【问题描述】:

git-log 手册页说:

git log [options] [since..until] [[--] path...]

自从..直到 仅显示指定的两个提交之间的提交。当 or 被省略,默认为 HEAD,即 当前分支。如需更完整的拼写方式列表 和 ,参见 gitrevisions(7)。

当我为 repo 的一些参考做 git-log 时,我得到了漏洞日志:

$ git log HEAD^ HEAD
commit 1e939a4f7097efd03b8a66607b561c5f698b3082
Author: Vasiliy <dixel@unen.(none)>
Date:   Wed Apr 11 13:58:03 2012 +0400

    3 commit

commit 1da7dcfc1920130f3de9a7c6b8f02d68923d12b7
Author: Vasiliy <dixel@unen.(none)>
Date:   Wed Apr 11 13:57:50 2012 +0400

    second commit

commit ee8d884f5fb364f667f8dcbf27b23afb3a4eeb85
Author: Vasiliy <dixel@unen.(none)>
Date:   Wed Apr 11 13:57:31 2012 +0400

    first commit

$ git branch
* master

我应该怎么做才能显示自某些修订以来的日志?

【问题讨论】:

    标签: git


    【解决方案1】:

    你不是错过了.. 吗?

    git log HEAD^..HEAD 
    

    【讨论】:

    • 是的,我认为当使用 git log 没有 .. 时,它只是将这些不同的引用视为开始列出提交的点。所以git log feature1 master feature2 bugfixA 将给出一个提交列表,其中包括出现在这些分支中的 any 上的任何提交(这可能会产生稍微奇怪的乱序输出)
    【解决方案2】:

    如果你使用git log HEAD~ HEAD会显示来自HEAD和HEAD的所有内容~

    git log HEAD~..HEAD 表示 git log 包括 HEAD~ 并最多提交 HEAD

    【讨论】:

      猜你喜欢
      • 2011-07-12
      • 2019-01-27
      • 2022-11-15
      • 2021-04-29
      • 2018-01-06
      • 2013-01-15
      • 2020-06-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多