title: Using git to publish to a website
body: <p>I used this guide to use git to autopublish my changes on my website when I push to my remote origin git repository:</p>
  
  <p><a href="http://www.lwp.ca/james/2010/03/using-git-to-manage-online-website-projects/">http://www.lwp.ca/james/2010/03/using-git-to-manage-online-website-projects/</a></p>
  
  <p>Here's my /hooks/post-update file:</p>
  
  <pre><code>cd ../../public_html/dir/wbg
  env -i git pull
  </code></pre>
  
  <p>Here's my directory structure:</p>
  
  <p>/home/git/wbg.git  &lt;-- my remote git repository</p>
  
  <p>/home/public_html/dir/wbg &lt;-- my web folder</p>
  
  <p>When I run</p>
  
  <pre><code>git push origin master
  </code></pre>
  
  <p>The repository updates but my web folder is still empty. Any ideas?</p>
  
  <p>Edit: if any future traffic sees this, my real problem was that BOTH your remote origin AND your destination website directory must be git repositories. You can't just set it up to copy your project to a new folder unless that folder is also a git repo.</p>