git 如何使用命令行搜索提交消息?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3826748/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 09:11:09 来源:igfitidea点击:
How to search in commit messages using command line?
提问by Coderama
Possible Duplicate:
How to search through all commits in the repository?
可能的重复:
如何搜索存储库中的所有提交?
Is there a way to search through commit headers using the command line?
有没有办法使用命令行搜索提交标头?
回答by hobbs
git log --grep=<pattern>
Limit the commits output to ones with log message that matches the
specified pattern (regular expression).
-- git 帮助日志
回答by czchen
git log --oneline | grep PATTERN