Search string in file.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Mon, 09 Oct 2017 14:42:32 +0300
changeset 2195 3556ec0e48be
parent 2194 60f74f8b5967
child 2196 4709306e4ec8
Search string in file.
git.rst
--- a/git.rst	Mon Oct 09 13:37:12 2017 +0300
+++ b/git.rst	Mon Oct 09 14:42:32 2017 +0300
@@ -435,9 +435,23 @@
 To search in all history::
 
   $ git log -S$PATT
+  $ git log --pickaxe-regex=$PATT
   $ git log -G$PATT
   $ git grep -i PATT $(git rev-list --all) -- '*.[ch]'
 
+.. note::
+
+   ``-S`` search occurences in diff chunks, while ``-G`` detects changes in match count.
+
+https://git-scm.com/book/en/v2/Git-Tools-Searching
+  Git Tools - Searching.
+https://stackoverflow.com/questions/1337320/how-to-grep-git-commit-diffs-or-contents-for-a-certain-word
+  How to grep Git commit diffs or contents for a certain word?
+https://stackoverflow.com/questions/4468361/search-all-of-git-history-for-a-string
+  Search all of Git history for a string?
+https://stackoverflow.com/questions/2928584/how-to-grep-search-committed-code-in-the-git-history
+  How to grep (search) committed code in the git history?
+
 Find most recent tag for revision.
 ==================================
 ::