git log --cherry-pick A..B-我做错了什么? [英] git log --cherry-pick A..B - what am I doing wrong?
问题描述
为了找到分支 working
上的提交,这些提交没有合并/挑选到 master
上,但我正在运行
In order to find commits on branch working
not merged/picked to master
yet I'm running
git log --format="%h %aN %ai %f" --cherry-pick --no-merges master..working
据了解这里.
但是如此处所述'm查找在 master
和 正在工作
上的提交,只是由于选择樱桃而导致提交ID有所不同.
But as described here I'm finding commits which are on master
and working
only varying in commit IDs due to cherry-picking.
没有将 working
合并到 master
中,反之亦然.
Neither working
has been merged to master
nor vice versa.
即使我手动从 working
到 master
手动选择一个提交,它也会在运行上述命令时显示.
Even when I manually cherry-pick a commit from working
to master
it will show up running the above command.
实际上-cherry-pick
似乎根本没有效果,如 | wc
所示.
Acutally --cherry-pick
seems to have no effect at all, as |wc
show.
我在做什么错了?
更新:
实际上ElpieKay和torek都是对的,我的最初命令也可以使用.不幸的是,我不知道我们是否使用了一些樱桃酱".我不知道在摘樱桃后哪些更改会提交的魔术
Actually both ElpieKay and torek are right and my initial command would have worked, too. Unfortunately I did not know we're using some "cherry-pickish" magic I did not know about which alters commits after cherry-picking
.
推荐答案
As ElpieKay mentioned in a comment, you need the three-dot notation. However, just adding the three-dot notation is not sufficient: you will also want to add --left-only
or --right-only
(depending on which side of the symmetric difference you put the A
and B
parts, of A...B
, on).
注意:
为了找到分支
working
上的提交,这些提交尚未合并/挑选到master
上,但是[我用过]master..working
In order to find commits on branch
working
not merged/picked tomaster
yet [I used]master..working
因此,在这里,您需要-仅右主机...正在工作
.您也可以保留-no-merger
.如果合并仅显示在 master
上,则实际上并不需要-no-merges
,但这可能是无害的.但是请注意,-no-merges
完全消除了所有合并,无论它们的补丁ID是什么.
So here, you'd want --right-only master...working
. You can keep --no-merges
as well. If the merges only show up on master
you don't actually need --no-merges
, but it's probably harmless. Note, however, that --no-merges
completely eliminates all merges, regardless of their patch-IDs.
这篇关于git log --cherry-pick A..B-我做错了什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!