# HG changeset patch # User Oleksandr Gavenko # Date 1507549352 -10800 # Node ID 3556ec0e48be120233f534b10351ff8a70644d36 # Parent 60f74f8b5967b17d5dc03d5c08bb8fc4dd64bcde Search string in file. diff -r 60f74f8b5967 -r 3556ec0e48be 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. ================================== ::