git log显示两个分支之间的提交不同,包括共同祖先

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

[在从主分支(例如feature)创建的功能分支(例如master)上工作时,我使用以下git命令查看已添加到feature分支的提交列表不在master分支上的代码:

git log --oneline master..HEAD

这会输出feature上没有的提交的简短摘要(注意,此命令在签出master分支后运行):

feature

问题是,它没有显示$ git log --oneline master..HEAD 1ca070a (HEAD -> feature) foo the bar 03a1047 baz the wuz c9e8279 fop the sip 6ee6d6f up the ante 5812200 bop the binky 分支上的共同祖先提交。我想要的命令是再添加一行,这是共同的祖先提交,如下所示:

master

[我希望用1ca070a (HEAD -> feature) foo the bar 03a1047 baz the wuz c9e8279 fop the sip 6ee6d6f up the ante 5812200 bop the binky fb37d68 (master) fuzzy the wuzzy 替换master将在共同祖先之前包含一个提交,因此包括共同祖先,

master~1

但是无论我指定git log --oneline master~1..HEAD 还是master,日志摘要始终相同。

master~1

我的问题是,如何在日志摘要中包括公共祖先提交?请注意,公共祖先不一定是$ git log --oneline master~1..HEAD 1ca070a (HEAD -> feature) foo the bar 03a1047 baz the wuz c9e8279 fop the sip 6ee6d6f up the ante 5812200 bop the binky 分支的尖端。

git git-branch git-diff git-log
2个回答
1
投票

我发现这种master包含太多


1
投票
似乎没有git log --graph命令可让您完全执行此操作。 --simplify-by-decoration语法的意思是:

git上提交但在master..HEAD

不是

© www.soinside.com 2019 - 2024. All rights reserved.