title: Auto Deploying with Git
body: <p>I am wondering if anyone has a better strategy for this scenario.</p>
  
  <p>I am currently hosting my own remote git repo on the same box as the webserver.</p>
  
  <p>All git repos are under the git user. </p>
  
  <pre><code>sudo -uwww-data -gwww-data git --git-dir=/var/www/website/.git --work-tree=/var/www/website pull
  </code></pre>
  
  <p>I have a cron job running as root every minute that executes this command. The git repo in the web folder is cloned from the same box to git's home dir where it's stored instead of through ssh.</p>
  
  <p>So my question: Since git doesn't own the web files, it can't move the site using a git hook. I would assume I don't want git to have sudo, nor would that work via a git hook, right? Is there something that will deploy the site faster than every minute? I don't want the operation to be very expensive. </p>
  
  <p>Is there some kind of daemon root could run and listen for some kind of notification? Like having it watch a file's last modified time?</p>