Cla*_*oft 7 git git-log git-branch
请考虑以下提交历史记录:
1---R---3---5---P-> # patch-v1.1
\ \
2---4---+---8---+---10---R-> # release-v2.0
\ /
6---7---9 # feature-foo
--> time
# 1 - 10 are commits
# P is a patch release commit
# R are major release commits
# + marks a merge commit
Run Code Online (Sandbox Code Playgroud)
我想生成更改日志release-v2.0,但由于P (patch-v1.1)已经发布,它的更改不应该是v2.0更改日志的一部分.我可以将git log命令配置为仅列出提交2, 4, 6 .. 11(即,来自release-v2.0和的提交feature-foo)吗?
ssc*_*rth 10
使用git log R --not P.这git log P..R与@ micha-wiedenmann的评论相同,但我发现前一种语法更多.是的,它将包括2, 4, 6, 7, 9因为它们按时间顺序排列(就创作的时间而言)并不重要,但它们在DAG中的位置.在R --not P集合理论方面,你基本上可以创建R中的P的补集.