title: git behind proxy: remote HEAD refers to nonexistent ref, unable to checkout
body: <p>When trying to clone ANY repository via https from github, we get:</p>
  
  <pre><code>git clone https://github.com/rails/rails.git
  Cloning into rails...
  remote HEAD refers to nonexistent ref, unable to checkout
  </code></pre>
  
  <p>Our server is behind a proxy.  We have defined http_proxy and https_proxy appropriately.  All other functions are working.  </p>
  
  <p>git version is 1.7.5.4</p>
  
  <p>Server is Ubuntu Server 11.04.</p>
  
  <p>Note that since this happens with <strong>EVERY</strong> github repository we've tried, we strongly believe it's not a problem with the refs in the repository.  We've tried such well-known repositories as jquery and rails - if the problem were in those repositories there'd be a lot of people complaining.  I believe strongly the problem is with git and the proxy, but all my googling has not lead to a solution.</p>
  
  <p>As an additional data point, clones seem to work fine if they're http.  It's only the https clones that fail with this error.</p>
  
  <p>Note that I don't think this question is a duplicate, since the other questions with this error focus on problems with the repository - not working with git and a proxy.</p>