我想做
pairedDifferences.Add(new int[] { numbers[i], numbers[a], difference });
然后使用$ git log - 5
* adc24eb Jim > (HEAD -> demo) fixup
* cb6a1a7 Jim > fixup
* 60d7150 Jim > (origin/demo) Much prettier demo output.
* a8112c2 Michael > Complete ugly demo:
执行一些操作。而不是通过SHA引用该提交,如
a8112c2
,我想输入类似
的内容$ git <command> a8112c2
其中%ugly通过git扩展到最近提交的SHA,其提交消息的第一行包含单词&#34; ugly&#34;。
这是什么神奇的语法?
我99%肯定以前曾被问过,但我找不到它。
答案 0 :(得分:4)
man git-rev-parse
是你的朋友。看起来你想要:
:/<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.
例如:
git show :/ugly