From ff4afe4683754fc294f8eefcefb856420ff1cf82 Mon Sep 17 00:00:00 2001 From: Edy Ionescu Date: Mon, 4 Mar 2019 13:31:32 +0200 Subject: [PATCH] Add --grep flag to git-log (#25158) --- guide/english/git/git-log/index.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/guide/english/git/git-log/index.md b/guide/english/git/git-log/index.md index 20547340e2..eed612f6c1 100644 --- a/guide/english/git/git-log/index.md +++ b/guide/english/git/git-log/index.md @@ -108,6 +108,21 @@ One of the benefit of using this command is that it enables you to get a overvie There are may other options you could use in combination with ```--graph```. Couple of them are ```--decorate``` and ```--all```. Make sure to try these out too. And refer to [documantation](https://git-scm.com/docs/git-log) for more helpful info. +#### --grep + +```git log --grep ``` + +The ```--grep``` flag enables you to search for commit messages that match a regular expression ``. Use it in combination with `-i` option for case-insensitive searches: + +```git log --oneline -i --grep=component``` + +The output would be similar to: + +``` +* 7e3934b Add hint for Compose React Components (#8705) +* c4e6a84 Add hint for "Create a Component with Composition" (#8704) +``` + #### More Information: - [Git Basics - Viewing the Commit History](https://git-scm.com/book/en/v2/Git-Basics-Viewing-the-Commit-History)