Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Probably the simplest way to achieve this is with <a href="https://git-scm.com/docs/git-archive" rel="noreferrer"><code>git archive</code></a>. If you really need just the expanded tree you can do something like this.</p> <pre><code>git archive master | tar -x -C /somewhere/else </code></pre> <p>Most of the time that I need to 'export' something from git, I want a compressed archive in any case so I do something like this.</p> <pre><code>git archive master | bzip2 &gt;source-tree.tar.bz2 </code></pre> <p>ZIP archive:</p> <pre><code>git archive --format zip --output /full/path/to/zipfile.zip master </code></pre> <p><a href="https://git-scm.com/docs/git-archive" rel="noreferrer"><code>git help archive</code></a> for more details, it's quite flexible.</p> <hr> <p>Be aware that even though the archive will not contain the .git directory, it will, however, contain other hidden git-specific files like .gitignore, .gitattributes, etc. If you don't want them in the archive, make sure you use the export-ignore attribute in a .gitattributes file and commit this before doing your archive. <a href="http://feeding.cloud.geek.nz/2010/02/excluding-files-from-git-archive.html" rel="noreferrer">Read more...</a></p> <hr> <p>Note: If you are interested in exporting the index, the command is</p> <pre><code>git checkout-index -a -f --prefix=/destination/path/ </code></pre> <p>(See <a href="https://stackoverflow.com/a/160719/413020" title="Greg&#39;s answer">Greg's answer</a> for more details)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload