title: Difference between different git search commands
body: <p>A question from a beginner: there are several ways to search in git history. 
  To me, it is not clear what, the difference between the commands really is:</p>
  
  <ol>
  <li><code>git log</code>, e.g. <code>git log -S 'for what you search' --all</code> to search for a string in all branches and 
  <code>git log -G 'search for regexpr' --all</code> to search for regexpr. See for example <a href="https://stackoverflow.com/questions/4468361/search-all-of-git-history-for-a-string">here</a></li>
  <li><code>git log --grep 'pattern'</code></li>
  <li><code>git rev-list</code>, e.g. <code>git rev-list --grep='string' --all</code></li>
  <li><code>git grep</code>, e.g. <code>git grep "string or regexpr" $(git rev-list --all)</code> from <a href="https://stackoverflow.com/a/2929502/5784831">here</a></li>
  <li><code>gitk</code>, e.g. <code>gitk file.txt</code> a gui interface</li>
  <li><code>git log --all --full-history -- **/thefile.*</code> to search for a filename in history from <a href="https://stackoverflow.com/a/7203551/5784831">here</a>.</li>
  <li><code>git diff --word-diff-regex=. &gt; changes.txt</code> combined with <code>grep -oP '\+[^\+]+\+' changes.txt | tr -d '\+'</code> to display changes on a character basis. From <a href="https://stackoverflow.com/q/53414581/5784831">here</a>. This even works if changes are not commited yet.</li>
  </ol>
  
  <p>My poor understanding is that </p>
  
  <ul>
  <li><code>git log</code> searches in the commit messages? It seems to be based on <code>rev-list</code>? From the docs: </li>
  </ul>
  
  <blockquote>
    <p>Shows the commit logs. The command takes options applicable to the git
    rev-list command to control what is shown and how, and options
    applicable to the git diff-* commands to control how the changes each
    commit introduces are shown.</p>
  </blockquote>
  
  <ul>
  <li><code>git-rev-list</code> seems to be a more basic command as it operates on the commit object (or tree object?). From the docs: </li>
  </ul>
  
  <blockquote>
    <p>git-rev-list - Lists commit objects in reverse chronological order</p>
  </blockquote>
  
  <ul>
  <li><code>git grep</code> seems to search everywhere: in files, blobs, trees and commit objects? From the docs:</li>
  </ul>
  
  <blockquote>
    <p>git-grep - Print lines matching a pattern. Look for specified patterns
    in the tracked files in the work tree, blobs registered in the index
    file, or blobs in given tree objects. Patterns are lists of one or
    more search expressions separated by newline characters. An empty
    string as search expression matches all lines.</p>
  </blockquote>
  
  <p>I used the <a href="https://git-scm.com/book/en/v2/Git-Internals-Git-Objects" rel="nofollow noreferrer">Git book</a> as reference.</p>