title: How do I git checkout a specific directory and strip the path to that directory?
body: <p>I have a mono repo and want to checkout all the files from a path into a directory on my web server.</p>
  
  <p>I know that I can checkout a directory by doing: <code>git checkout origin/master -- path/to/directory</code>, but that gives me my files in <code>path/to/directory</code>.</p>
  
  <p>I want the checkout files, from the remote directory, in my current directory. So I have tried <code>git --work-tree=. checkout origin/master -- path/to/directory</code>. But that does not alter the output directory path.</p>
  
  <p>Right now, I just move the files but this quickly gets tedious (<code>mv path/to/directory/* .</code>). Is there a git command that can help me?</p>
  
  <p>This question is similar to this unanswered question: <a href="https://stackoverflow.com/questions/23044480/git-checkout-to-specific-directory">Git checkout to specific directory</a></p>