title: How can I move a directory in a Git repo for all commits?
body: <p>Let's say I have a repo that includes this directory structure:</p>
  
  <pre><code>repo/
    blog/
      _posts/
        some-post.html
    another-file.txt
  </code></pre>
  
  <p>I want to move <code>_posts</code> to the top level of the repo, so the structure will look like this:</p>
  
  <pre><code>repo/
    _posts/
      some-post.html
    another-file.txt
  </code></pre>
  
  <p>This is simple enough with <code>git mv</code>, but I want to make the history look as though <code>_posts</code> <em>always</em> existed at the root of the repo, and I want to be able to get the entire history of <code>some-post.html</code> via <code>git log -- _posts/some-post.html</code>. I imagine I can use some magic with <code>git filter-branch</code> to accomplish this, but I haven't figured out exactly how to do that. Any ideas?</p>