title: What does tree-ish mean in Git?
body: <p>I'm very confused about how to use <code>git archive</code>.</p>
  
  <p>I have a git repository with folder  <em>Foo</em>, <em>Bar</em> and <em>Baz</em> at the top level.  I need to export folder <strong>Foo</strong> in a SVN-ish sort of way for quick test deployment.</p>
  
  <p>I learned that I could use <code>git-archive</code> in an <a href="https://stackoverflow.com/questions/4039700/setting-up-a-project-directory-structure-for-git-repo-of-a-website">SVN-ish export sort of way</a>.</p>
  
  <p>But here's the thing, <strong>The following works fine:</strong></p>
  
  <pre><code>git archive master | tar -x -C ~/destination
  </code></pre>
  
  <p>it results in <em>Foo</em>, <em>Bar</em>, <em>Baz</em> folders in the <em>destination</em> folder.</p>
  
  <p><strong>However, the following will error out</strong> with <code>fatal not a valid object name</code>:</p>
  
  <pre><code>git archive master/foo | tar -x -C ~/destination
  </code></pre>
  
  <h3>The Documentation</h3>
  
  <p>Looking as the synopsis for the <code>git archive</code> program I see that it can take a <code>&lt;tree-ish&gt; [path]</code> as a parameter (synopsis summarized to relevant parts):</p>
  
  <pre><code>git archive &lt;tree-ish&gt; [path...]
  </code></pre>
  
  <p><strong>If</strong> <code>master/foo</code> <strong>is not</strong> <code>tree-ish</code><strong>, then what is?</strong></p>