title: How can I shallow clone all files from a repository at a specific commit?
body: <p>I am trying to <s>extract</s> shallow clone all files from a repository at a specific commit.  I would like to extract these files to an alternate location without affecting the HEAD of the existing repository.</p>
  
  <p>This is the command I'm running to get those files...</p>
  
  <pre><code>git --git-dir="C:\temp\repository" --work-tree="C:\temp\files" checkout -f "e2f4b8cf188c87db6a11c6f421b06f701dd6b07b"
  </code></pre>
  
  <p>The above command works to extract the files I want, but my problem is this leaves my repository with a detached HEAD.</p>
  
  <p>What is the best way to extract these files?</p>
  
  <p>Possible duplicate: <a href="https://stackoverflow.com/questions/31278902/how-to-shallow-clone-a-specific-commit-with-depth-1">How to shallow clone a specific commit with depth 1?</a></p>
  
  <p><strong>edits for clarification:</strong></p>
  
  <ul>
  <li>There is an automated process that commits to this repository. (which is why i don't want to detach the HEAD)</li>
  <li>I want to extract all files from the repository from a specific point. (i know the commit id)</li>
  <li>I'd like to extract these files to an alternate location.</li>
  </ul>