git log --grep 用法

使用方法:
git log 支持正则表达式搜索提交消息

git log --grep

使用场景:
比如我想 checkout 到很久以前的某个commit,我只大概记得当时的commit log 关键字,对于这种场景,最笨的方法是用肉眼看 git log,很显然这样效率很低,此时,git log --grep 就派上用场了,比如我想找到带 gif 关键字的log,我只需要这样 git log --grep 'gif',这是最简单的需求,也是最常用的方法。git log --grep 配合正则表达式可以搜索到更复杂的关键字,这里就不再讨论了。

你可能感兴趣的:(git log --grep 用法)