title: How do I chown to inherit parent directory's owner and group or the current account user
body: <p>In terminal I know I can</p>
  
  <pre><code>chown whatever:whatever .*
  </code></pre>
  
  <p>What I want to do is dynamically set username and group to the current domain owner rather than root. Is there an easy way to do this?</p>
  
  <p>Some background: I'm pushing to my server using Git as root then checking out to public_html.  This makes any new files and directories owned by root:root. I want to add a line to hooks/post-receive to change the owner to the domain user rather than root but I don't want to have to specify the domain user explicitly if I don't have to.</p>