title: Update the root directory of a branch from the subdirectory of another
body: <p>Developing on github, I often maintain a <code>html/</code> or <code>_site/</code> subdirectory in my master branch where I generate web-based documentation for the project.  I'd like to switch to my gh-pages branch and <code>pull</code> just the contents of this <code>html</code> directory into the root of the gh-pages branch, so it will render as a nice website through github (which automatically renders html in <code>gh-pages</code> at <code>username.github.com/repositoryname</code>).  What is the best workflow to do this?</p>
  
  <p>If I don't yet have the gh-pages branch set up, I can branch, clear the branch, and copy in the contents of the <code>html</code> directory and presto, I have the a site ready to go.  But I'm not sure how best to later update the gh-pages branch.  </p>
  
  <pre><code>git branch gh-pages
  git checkout gh-pages
  # Remove files I don't need from the gh-pages branch
  rm -rf data/ man/ R/ README.md NEWS NAMESPACE DESCRIPTION demo/
  # move documentation to the root
  mv inst/doc/html/* .
  # remove the rest
  rm -rf inst/
  git add *
  git commit -a -m "gh-pages documentation"
  git push origin gh-pages
  git checkout master
  </code></pre>
  
  <p>Now what should I do to update the gh-pages branch later?  It sounds like this might involve <a href="https://git-scm.com/book/en/v1/Git-Tools-Subtree-Merging" rel="noreferrer">subtree merging</a> but I'm not quite sure.  </p>