title: Git pulling depends on the current dir
body: <p>I am trying to <code>git pull</code> some repository via root user from any directory. </p>
  
  <p>For example, executing <code>git pull</code> from <code>/root/</code>:</p>
  
  <pre><code>#&gt; cd ~
  #&gt; sudo -u dmalikov git --git-dir=/home/dmalikov/path/to/repo/.git pull 
  /usr/libexec/git-core/git-sh-setup: line 142: cd: /root/.: Permission denied
  Cannot chdir to /root/., the toplevel of the working tree
  </code></pre>
  
  <p>And executing <code>git pull</code> from <code>/</code>: </p>
  
  <pre><code>#&gt; cd /
  #&gt; sudo -u dmalikov git --git-dir=/home/dmalikov/path/to/repo/.git pull 
  Already up-to-date.
  </code></pre>
  
  <p>Why did current directory affects <code>git pull</code>ing command?</p>
  
  <p>How can that redundant <code>cd</code> be avoided? </p>