给定两个 git 提交,我如何确定(最好使用管道命令)它们之间的历史记录是否是线性的?
换句话说,我想知道我是否有这个:
A-B-C-D-E-F-G
而不是这个:
/-C-\
A-B -E-F-G
\-D-/
git log --min-parents=2
只会显示至少有 2 个父项的提交(例如:合并提交)
你可以运行:
# for esthetics : --oneline will output one single line per filtered commit
git log --oneline --min-parents=2 A..G
# if output is empty : linear history
# and :
git log --oneline --min-parents=2 A..G | wc -l
# should give you the number of merge commits between A and G
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)