title: What are commit-ish and tree-ish in Git?
body: <h2>The Question</h2>
  
  <p>What are specific examples of commit-ish and tree-ish in Git?</p>
  
  <p>The Stack Overflow question <a href="https://stackoverflow.com/q/4044368/456814">"What does tree-ish mean in git?"</a> deals
  with tree-ish specifically, but I want to understand more about <strong><em>both</em></strong>.</p>
  
  <h2>Background</h2>
  
  <h3>Usages in Documentation</h3>
  
  <p><a href="https://www.kernel.org/pub/software/scm/git/docs/" rel="noreferrer">The Git documentation</a> makes several references to "commit-ish" and
  "tree-ish". For example, if you're examining <a href="https://github.com/git/git" rel="noreferrer">the Git source code</a>:</p>
  
  <pre class="lang-none prettyprint-override"><code>$ git grep --files-with-matches --extended-regexp "commit(-)*ish"
  config.txt
  git-describe.txt
  git-fast-import.txt
  git-name-rev.txt
  git-push.txt
  git-rebase.txt
  git-rev-parse.txt
  git.txt
  gitcli.txt
  glossary-content.txt
  howto/revert-branch-rebase.txt
  revisions.txt
  </code></pre>
  
  <p>and</p>
  
  <pre class="lang-none prettyprint-override"><code>$ git grep --files-with-matches --extended-regexp "tree(-)*ish" | \
  $ grep --invert-match RelNotes
  diff-format.txt
  diff-generate-patch.txt
  git-archive.txt
  git-cat-file.txt
  git-checkout.txt
  git-diff-index.txt
  git-diff-tree.txt
  git-ls-files.txt
  git-ls-tree.txt
  git-merge-tree.txt
  git-read-tree.txt
  git-reset.txt
  git-svn.txt
  git.txt
  gitcli.txt
  gittutorial-2.txt
  glossary-content.txt
  revisions.txt
  </code></pre>
  
  <h3>Definitions</h3>
  
  <p>The Git documentation <a href="https://www.kernel.org/pub/software/scm/git/docs/#_identifier_terminology" rel="noreferrer">defines what "commit-ish" and "tree-ish" are</a>:</p>
  
  <blockquote>
  <pre><code>&lt;tree&gt;
  </code></pre>
    
    <p>Indicates a tree object name.</p>
  
  <pre><code>&lt;commit&gt;
  </code></pre>
    
    <p>Indicates a commit object name.</p>
  
  <pre><code>&lt;tree-ish&gt;
  </code></pre>
    
    <p>Indicates a tree, commit or tag object name. A command that takes a <code>&lt;tree-ish&gt;</code>
    argument ultimately wants to operate on a <code>&lt;tree&gt;</code> object but automatically
    dereferences <code>&lt;commit&gt;</code> and <code>&lt;tag&gt;</code> objects that point at a <code>&lt;tree&gt;</code>.</p>
  
  <pre><code>&lt;commit-ish&gt;
  </code></pre>
    
    <p>Indicates a commit or tag object name. A command that takes a <code>&lt;commit-ish&gt;</code>
    argument ultimately wants to operate on a <code>&lt;commit&gt;</code> object but automatically
    dereferences <code>&lt;tag&gt;</code> objects that point at a <code>&lt;commit&gt;</code>.</p>
  </blockquote>
  
  <h2>The Documentation isn't Clear Enough</h2>
  
  <p>Even though the documentation above defines what "commit-ish" and "tree-ish" are,
  I still find it to be too vague and unclear.</p>
  
  <p><strong>What are specific examples of "commit-ish" and "tree-ish", and how are they
  different from each other?</strong></p>