title: why is checkout -f the right thing to put in a post-receive hook?
body: <p>I have an account on Dreamhost and they have instructions on using Git to track files in a custom WordPress theme. Their instructions, at, <a href="https://help.dreamhost.com/hc/en-us/articles/227816388-Using-Git-with-DreamPress" rel="nofollow noreferrer">https://help.dreamhost.com/hc/en-us/articles/227816388-Using-Git-with-DreamPress</a>, are the same as many other websites that suggest same.  For example, <a href="http://git-memo.readthedocs.io/en/latest/deploy.html" rel="nofollow noreferrer">http://git-memo.readthedocs.io/en/latest/deploy.html</a></p>
  
  <p>You put in an executable script in a bare repo's <code>hooks/post-receive</code> directory and it calls a git "checkout -f".  Here is the example script</p>
  
  <pre><code>#!/bin/sh
  GIT_WORK_TREE=/home/user/theme-directory git checkout -f  
  </code></pre>
  
  <p>Here is what I don't understand. Why "checkout -f"?  That only changes the name of the branch being tracked, it does not bring it up to date. Shouldn't there be a pull (or fetch) the new content? Does checkout have more power than I undersand?</p>