通过git show轻松访问合并提交?
鉴于以下最近的历史记录,是否有任何方法可以通过类似于通过git show轻松访问合并提交?,git,Git,鉴于以下最近的历史记录,是否有任何方法可以通过类似于git show HEAD^的方式来访问与merge commit in HEAD合并的任何提交 * abcdef1 (HEAD -> master, origin/master, origin/HEAD) Yes: HEAD^ means HEAD^1 which means the first parent of abcdef1 which is fedcbca1, while HEAD^2 means the second pa
git show HEAD^
的方式来访问与merge commit in HEAD合并的任何提交
* abcdef1 (HEAD -> master, origin/master, origin/HEAD) Yes: HEAD^
means HEAD^1
which means the first parent of abcdef1
which is fedcbca1
, while HEAD^2
means the second parent of abcdef1
which is beeg00d
. From that second parent, another ^1
leads to c0ffee1
and a third ^1
leads to e3ca62a
. (A fourth leads back to fedcba1
.)
Hence:
HEAD^2^1^1
*abcdef1(HEAD->master,origin/master,origin/HEAD)Yes:HEAD^
表示HEAD^1
的第一个父项,即fedcbca1
,而HEAD^2
表示abcdef1
的第二个父项,即beeg00d
。从第二个父级,另一个^1
导致c0ffee1
,第三个^1
导致e3ca62a
。(第四条返回到fedcba1
)
因此:
HEAD^2^^
例如,选择e3ca62a
任何时候只要有^1
,就可以删除1
,给出:
HEAD^2~2
每当您按顺序重复n个^
字符时,可以将其替换为~n
,给出:
HEAD^2~2
虽然在本例中,这并不比只键入两次^
短