[在从主分支(例如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
分支的尖端。
我发现这种master
包含太多
git log --graph
命令可让您完全执行此操作。 --simplify-by-decoration
语法的意思是:在git
上提交但在master..HEAD
上不是