标签之间的 Git Log 显示来自另一个标签的提交

问题描述 投票:0回答:1

我正在执行命令来获取两个标签之间的提交:


 git log --merges '7.0.8'...'7.0.9' --oneline

除了这两个标签之间的提交之外,我还收到了一些在 7.0.8 标签之前进行的提交,它位于 7.0.7..7.0.8 之间

以下是我得到的提交:

enter image description here

黄线下的所有提交均位于 7.0.8 之后

这让我有点困惑,因为我有任务检索两个标签之间的提交。

这里是 GitLab 存储库中 Git 历史记录的屏幕截图:

enter image description here

我预计会在输出“3f5c081”中看到最后一次提交,但目前我不清楚为什么我会看到执行命令时应该出现的提交:


 git log --merges '7.0.7'...'7.0.8' --oneline

也许有人可以解释这种行为?

我希望只看到 7.0.8..7.0.9 范围内的提交

git tags commit git-log
1个回答
0
投票

你的历史中有合并提交,盲目猜测这些合并提交带来的这些提交不是你想到的提交。


要更清楚地了解提交如何相互关联,请将

--graph
添加到您的
git log
命令中:

# view the combined history for the tags you want to inspect:
git log --oneline --graph 7.0.9 7.0.8 7.0.7

# when viewing partial history, like `A..B` or `A...B`,
# --boundary may help:
git log --oneline --graph --boundary 7.0.8...7.0.9
© www.soinside.com 2019 - 2024. All rights reserved.