通过提交消息标题引用 git 提交
Refer to a git commit by commit message headline
如何通过提交消息标题中的文本/词来引用 git 提交?
我想避免:
- 鼠标复制/粘贴来自
git log
的提交哈希
- 输入十六进制 digits
长话短说:
引用匹配 <text>
:
的最新提交
:/<text>, e.g. :/fix nasty bug
引用可从 <rev>
获取的与 <text>
匹配的最新提交
<rev>^{/<text>}, e.g. HEAD^{/fix nasty bug}
手册页条目
引用可从 <rev>
获取的与 <text>
匹配的最新提交:
<rev>^{/<text>}, e.g. HEAD^{/fix nasty bug}
A suffix ^ to a revision parameter, followed by a brace pair that
contains a text led by a slash, is the same as the :/fix nasty bug
syntax below except that it returns the youngest matching commit
which is reachable from the <rev> before ^.
引用匹配 <text>
的任何位置的最新提交:
:/<text>, e.g. :/fix nasty bug
A colon, followed by a slash, followed by a text, names a commit
whose commit message matches the specified regular expression. This
name returns the youngest matching commit which is reachable from any
ref. The regular expression can match any part of the commit message.
To match messages starting with a string, one can use e.g. :/^foo.
The special sequence :/! is reserved for modifiers to what is
matched. :/!-foo performs a negative match, while :/!!foo matches a
literal ! character, followed by foo. Any other sequence beginning
with :/! is reserved for now. Depending on the given text, the
shell’s word splitting rules might require additional quoting.
如何通过提交消息标题中的文本/词来引用 git 提交?
我想避免:
- 鼠标复制/粘贴来自
git log
的提交哈希
- 输入十六进制 digits
长话短说:
引用匹配 <text>
:
:/<text>, e.g. :/fix nasty bug
引用可从 <rev>
获取的与 <text>
<rev>^{/<text>}, e.g. HEAD^{/fix nasty bug}
手册页条目
引用可从 <rev>
获取的与 <text>
匹配的最新提交:
<rev>^{/<text>}, e.g. HEAD^{/fix nasty bug}
A suffix ^ to a revision parameter, followed by a brace pair that
contains a text led by a slash, is the same as the :/fix nasty bug
syntax below except that it returns the youngest matching commit
which is reachable from the <rev> before ^.
引用匹配 <text>
的任何位置的最新提交:
:/<text>, e.g. :/fix nasty bug
A colon, followed by a slash, followed by a text, names a commit
whose commit message matches the specified regular expression. This
name returns the youngest matching commit which is reachable from any
ref. The regular expression can match any part of the commit message.
To match messages starting with a string, one can use e.g. :/^foo.
The special sequence :/! is reserved for modifiers to what is
matched. :/!-foo performs a negative match, while :/!!foo matches a
literal ! character, followed by foo. Any other sequence beginning
with :/! is reserved for now. Depending on the given text, the
shell’s word splitting rules might require additional quoting.