[英]git log, only commits that happened on branch pre-merge
If I have a structure like this. 如果我有这样的结构。
A---B---C----H---M topic
/ / \ / \
D----E---F---G---L---N master
/ /
I---J K other topics
And I want to git log
, only the commits that happened on the topic branch, without merges: 我想
git log
,只有在主题分支上发生的提交,没有合并:
Specifically ABH
, and nothing else. 特别是
ABH
,没有别的。
How would I do that? 我该怎么办?
Try with the option --no-merge
of git log
: 尝试使用选项
--no-merge
of git log
:
git log --no-merges --first-parent topic
That is: 那是:
--no-merges
Do not print commits with more than one parent.
不要打印具有多个父级的提交。
This is exactly the same as--max-parents=1
.这与
--max-parents=1
完全相同。
--first-parent
Follow only the first parent commit upon seeing a merge commit.
在看到合并提交时,仅遵循第一个父提交。 This option allows you to ignore the individual commits brought in to your history by such a merge.
此选项允许您忽略通过此类合并引入历史记录的各个提交。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.