title: Script for root to git pull as another user
body: <p>I have a script that I would like to have do a git pull inside another user's git directory.  This script is run by the root user.  For example:</p>
  
  <pre><code>cd /home/username/GitProject
  sudo -u username -i git pull
  </code></pre>
  
  <p>When I run this, I get:</p>
  
  <pre><code>fatal: Not a git repository (or any of the parent directories): .git
  </code></pre>
  
  <p>Is there a way to have my script do a git pull as <code>username</code>?</p>