gpt4 book ai didi

git log,仅提交发生在分支预 merge 上的提交

转载 作者:太空狗 更新时间:2023-10-29 13:59:10 25 4
gpt4 key购买 nike

如果我有这样的结构。

    A---B---C----H---M      topic
/ / \ / \
D----E---F---G---L---N master
/ /
I---J K other topics

我想git log,只记录在主题分支上发生的提交,没有 merge :
特别是A B H,没有别的。
我该怎么做?

最佳答案

尝试使用 git log 的选项 --no-merge :

git log --no-merges --first-parent topic

即:

--no-merges

Do not print commits with more than one parent.
This is exactly the same as --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.

关于git log,仅提交发生在分支预 merge 上的提交,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37606063/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com