From 9f3abb6daafae5a674dcade07338512d6d567a7c Mon Sep 17 00:00:00 2001 From: yang-wei Date: Sun, 3 May 2015 21:51:12 +0900 Subject: [PATCH] Add git grep --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.md b/README.md index 1165b37..8a614ea 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [Styled Git Status](#styled-git-status) - [Styled Git Log](#styled-git-log) - [Git Query](#git-query) + - [Git Grep](#git-grep) - [Merged Branches](#merged-branches) - [Fixup and Autosquash](#fixup-and-autosquash) - [Web Server for Browsing Local Repositories](#web-server-for-browsing-local-repositories) @@ -764,6 +765,32 @@ $ git show :/typo *Press `q` to quit.* + +### Git Grep +Grep pattern under your git versioned folder. + +Running: +``` +git grep aliases +``` +will show all the files containing the string *aliases*. + +![git grep aliases](http://i.imgur.com/q3WkUgl.png?1) + +*Press `q` to quit.* + +We can also use multiple flags for more advanced search. For example: + + * `-e` The next parameter is the pattern (including regex) + * `--and` Combine multiple patterns. + +Use it like this: +``` + git grep -e pattern --and -e anotherpattern +``` + +[*Read more about the Git `grep` command.*](http://git-scm.com/docs/git-grep) + ### Merged Branches Running: