title: Git + Smart HTTP problems (cannot push/pull)
body: <p>I've used SVN for years, but I want to test Git for the first time.</p>
  
  <p>I tried to use HTTP protocol in order to keep my previous credentials (made with <code>htpasswd</code>).</p>
  
  <p>I followed this procedure on my server:</p>
  
  <pre><code>$ aptitude install git-core apache2
  $ mkdir -p /var/git/repositories
  $ htpasswd -c /var/git/passwd my_account
  $ cat &gt; /etc/apache2/sites-available/git &lt;&lt; EOF
  &lt;VirtualHost *:80&gt;
      ServerName git.mydomain.com
  
      SetEnv GIT_PROJECT_ROOT /var/git/repositories
      SetEnv GIT_HTTP_EXPORT_ALL
      SetEnv REMOTE_USER=$REDIRECT_REMOTE_USER
  
      ScriptAlias / /usr/lib/git-core/git-http-backend/
  
      DocumentRoot /var/git/repositories
  
      &lt;Directory /var/git/repositories&gt;
          Options +ExecCGI +SymLinksIfOwnerMatch -MultiViews
          AllowOverride None
          Order allow,deny
          allow from all
      &lt;/Directory&gt;
  
      &lt;Location /&gt;
          AuthType Basic
          AuthName "Git Access"
          AuthUserFile /var/git/passwd
          Require valid-user
      &lt;/Location&gt;
  &lt;/VirtualHost&gt;
  EOF
  </code></pre>
  
  <hr>
  
  <pre><code>$ a2ensite git
  $ service apache2 reload
  
  $ cd /var/git/repositories
  $ git init --bare my_project.git
  $ git update-server-info
  </code></pre>
  
  <p>On my client, I do this:</p>
  
  <pre><code>$ git clone http://git.mydomain.com/my_project.git
  $ cd my_project
  $ cat &gt; test-file.txt &lt;&lt; EOF
  This is a test
  EOF
  $ git add test-file.txt
  $ git commit -m "My first commit"
  </code></pre>
  
  <p>Everything seems to be okay for now.</p>
  
  <p>As I want my content to be updated by my remote repository, I do <code>git pull</code>, but this doesn't work.
  Git returns the following message :</p>
  
  <blockquote>
    <p>Your configuration specifies to merge with the ref 'master' from the
    remote, but no such ref was fetched.</p>
  </blockquote>
  
  <p>Anyway, I'm alone on my code. I'll try to fix it later. Let's try to push to the server.</p>
  
  <p>So I do <code>git push</code>.</p>
  
  <blockquote>
    <p>No refs in common and none specified; doing nothing.<br />
    Perhaps you should specify a branch such as 'master'.<br />
    Everything up-to-date</p>
  </blockquote>
  
  <p>Okay... <em>"doing nothing"</em> but <em>"Everything is up-to-date"</em>?</p>
  
  <p>After a little check, I find and execute, the following command : <code>git push origin master</code>
  This time I have the following message :</p>
  
  <blockquote>
    <p>error: unpack failed: unpack-objects abnormal exit<br />
    To <a href="http://git.mydomain.com/my_project.git" rel="nofollow">http://git.mydomain.com/my_project.git</a><br />
    ! [remote rejected] master -> master (n/a (unpacker error))<br />
    error: failed to push some refs to 'http://git.mydomain.com/my_project.git'</p>
  </blockquote>
  
  <p>I tried to follow many tutorials on the web.</p>
  
  <p>I think my configuration is simple, so I can't understand why it doesn't work.</p>
  
  <p>Thanks for anyone who can help me.</p>
  
  <p><strong>EDIT :</strong></p>
  
  <p>I restarted from scratch, following <a href="http://www.kernel.org/pub/software/scm/git/docs/git-http-backend.html" rel="nofollow">http://www.kernel.org/pub/software/scm/git/docs/git-http-backend.html</a></p>
  
  <p>I don't need gitweb. I just want to  use HTTP protocol with Git client.</p>
  
  <p>So my virtualhost is :</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
      ServerName git.mydomain.com
  
      SetEnv GIT_PROJECT_ROOT /var/git/repositories
      SetEnv GIT_HTTP_EXPORT_ALL
      SetEnv REMOTE_USER=$REDIRECT_REMOTE_USER
  
      ScriptAlias / /usr/lib/git-core/git-http-backend/
  
      DocumentRoot /var/git/repositories
  
      &lt;Location /&gt;
          AuthType Basic
          AuthName "Git Access"
          AuthUserFile /var/git/passwd
          Require valid-user
      &lt;/Location&gt;
  
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>I have exactly the same errors.</p>
  
  <p><code>git pull</code> returns :</p>
  
  <blockquote>
    <p>Your configuration specifies to merge with the ref 'master' from the
    remote, but no such ref was fetched.</p>
  </blockquote>
  
  <p>and <code>git push origin master</code> returns :</p>
  
  <blockquote>
    <p>error: unpack failed: unpack-objects abnormal exit
    To <a href="http://git.mydomain.com/my_project.git" rel="nofollow">http://git.mydomain.com/my_project.git</a>
    ! [remote rejected] master -> master (n/a (unpacker error))
    error: failed to push some refs to 'http://git.mydomain.com/my_project.git'</p>
  </blockquote>