鉴于有一棵树如下所示:
d1a--d1b---d1c--d1d--d1e <dev>
/ / \
a--b--c---d---e--------f---g----h--i <master>
a
是最早的提交,而i
是最新提交, HEAD
d1a
已从主分支到新分支 dev ,添加了一些新的更改并合并了来自主的更改(来自{{1转到f
),然后最终合并回d1d
的'master'。
在执行git log / rev-list时,如何选择:
非常感谢任何提示/建议/提示!
答案 0 :(得分:-1)
来自man git-rev-parse
:
SPECIFYING RANGES
History traversing commands such as git log operate on a set of commits, not just a single commit. To these
commands, specifying a single revision with the notation described in the previous section means the set of commits
reachable from that commit, following the commit ancestry chain.
To exclude commits reachable from a commit, a prefix ^ notation is used. E.g. ^r1 r2 means commits reachable from r2
but exclude the ones reachable from r1.
This set operation appears so often that there is a shorthand for it. When you have two commits r1 and r2 (named
according to the syntax explained in SPECIFYING REVISIONS above), you can ask for commits that are reachable from r2
excluding those that are reachable from r1 by ^r1 r2 and it can be written as r1..r2.
A similar notation r1...r2 is called symmetric difference of r1 and r2 and is defined as r1 r2 --not $(git
merge-base --all r1 r2). It is the set of commits that are reachable from either one of r1 or r2 but not from both.
Two other shorthands for naming a set that is formed by a commit and its parent commits exist. The r1^@ notation
means all parents of r1. r1^! includes commit r1 but excludes all of its parents.
甚至有一个例子,所以我是RTFM; - )