title: Do a "git export" (like "svn export")?
body: <p>I've been wondering whether there is a good &quot;git export&quot; solution that creates a copy of a tree without the <code>.git</code> repository directory. There are at least three methods I know of:</p>
  <ol>
  <li><code>git clone</code> followed by removing the <code>.git</code> repository directory.</li>
  <li><a href="http://www.kernel.org/pub/software/scm/git/docs/git-checkout-index.html" rel="noreferrer"><code>git checkout-index</code></a> alludes to this functionality but starts with &quot;Just read the desired tree into the index...&quot; which I'm not entirely sure how to do.</li>
  <li><a href="http://code.google.com/p/git-export/" rel="noreferrer"><code>git-export</code></a> is a third-party script that essentially does a <code>git clone</code> into a temporary location followed by <code>rsync --exclude='.git'</code> into the final destination.</li>
  </ol>
  <p>None of these solutions really strike me as being satisfactory. The closest one to <code>svn export</code> might be option 1, because both require the target directory to be empty first. But option 2 seems even better, assuming I can figure out what it means to read a tree into the index.</p>