title: Git Fetch fails to work on bare repo, but git pull works on normal repo
body: <p>First, the big picture: I'm trying to write a git post-receive script for a Redmine / Gitolite server I'm running. As per various recommendations, I'm creating a bare and local repository for Redmine to read from, and I'm setting up a post-receive script on Gitolite to push changes into the Redmine repo.</p>
  
  <p>However, I'm very noobish with Git, so I'm unable to even do a simple task here >_&lt;. I think if I figure this out, I should be able to write the above script. After setting up my test repo, I've created two repos as a test.</p>
  
  <p>(The "Central Repo" is a Gitolite repository at git@localhost:testing)</p>
  
  <pre><code>cd /tmp
  mkdir /tmp/test
  $ git clone git@localhost:testing
  $ git clone git@localhost:testing testing2
  $ git clone git@localhost:testing --bare
  </code></pre>
  
  <p>Now when I run ls:</p>
  
  <pre><code>$ ls
  testing  testing2  testing.git
  </code></pre>
  
  <p>Now, I change the test file inside of the testing2, and then push the changes to the central repo.</p>
  
  <pre><code>$ cd testing2
  $ echo 'testline' &gt;&gt; test &amp;&amp; git commit --allow-empty-message -a -m '' &amp;&amp; git push 
  </code></pre>
  
  <p>As expected, if I run "git pull" on the "testing" folder, everything works as expected.</p>
  
  <pre><code>$ cd testing
  $ git pull
  remote: Counting objects: 5, done.
  remote: Total 3 (delta 0), reused 0 (delta 0)
  Unpacking objects: 100% (3/3), done.
  From localhost:testing
     3242dba..a1ca5ba  master     -&gt; origin/master
  Updating 3242dba..a1ca5ba
  Fast-forward
   test |    1 +
   1 files changed, 1 insertions(+), 0 deletions(-)
  $ diff ./test ../testing2/test
  $
  </code></pre>
  
  <p>As shown with the last "diff", the "testing" directory and "testing2" directory work exactly as expected. The "git pull" command synchronizes the two directories.</p>
  
  <p>However, if I cd into testing.git (aka: the bare repo), a git fetch / git reset --soft fails to update the bare repo to the latest version.</p>
  
  <pre><code>$ ls
  branches  config  description  HEAD  hooks  info  objects  packed-refs  refs
  $ git fetch
  remote: Counting objects: 5, done.
  remote: Total 3 (delta 0), reused 0 (delta 0)
  Unpacking objects: 100% (3/3), done.
  From localhost:testing
   * branch            HEAD       -&gt; FETCH_HEAD
  $ git reset --soft
  $ cd ..
  $ git clone ./testing.git testing3
  Cloning into testing3...
  done.
  $ cd testing3
  $ diff test ../testing2/test
  5a6
  &gt; testline
  </code></pre>
  
  <p>As you can see from the last example, the bare repository failed to get updated, and there is somehow a difference between the two files. What did I do wrong?</p>
  
  <p>Thanks in advance</p>