git.rst
changeset 2195 3556ec0e48be
parent 2190 f589976b8876
child 2209 6faf149a4f4c
equal deleted inserted replaced
2194:60f74f8b5967 2195:3556ec0e48be
   433   $ git grep -i $PATT -- '*.[ch]'
   433   $ git grep -i $PATT -- '*.[ch]'
   434 
   434 
   435 To search in all history::
   435 To search in all history::
   436 
   436 
   437   $ git log -S$PATT
   437   $ git log -S$PATT
       
   438   $ git log --pickaxe-regex=$PATT
   438   $ git log -G$PATT
   439   $ git log -G$PATT
   439   $ git grep -i PATT $(git rev-list --all) -- '*.[ch]'
   440   $ git grep -i PATT $(git rev-list --all) -- '*.[ch]'
       
   441 
       
   442 .. note::
       
   443 
       
   444    ``-S`` search occurences in diff chunks, while ``-G`` detects changes in match count.
       
   445 
       
   446 https://git-scm.com/book/en/v2/Git-Tools-Searching
       
   447   Git Tools - Searching.
       
   448 https://stackoverflow.com/questions/1337320/how-to-grep-git-commit-diffs-or-contents-for-a-certain-word
       
   449   How to grep Git commit diffs or contents for a certain word?
       
   450 https://stackoverflow.com/questions/4468361/search-all-of-git-history-for-a-string
       
   451   Search all of Git history for a string?
       
   452 https://stackoverflow.com/questions/2928584/how-to-grep-search-committed-code-in-the-git-history
       
   453   How to grep (search) committed code in the git history?
   440 
   454 
   441 Find most recent tag for revision.
   455 Find most recent tag for revision.
   442 ==================================
   456 ==================================
   443 ::
   457 ::
   444 
   458