title: Why does git fetch fail with "Could not resolve host: (nil)..." with https://github.com/mxcl/homebrew origin?
body: <p>I was unable to install <a href="http://brew.sh" rel="nofollow noreferrer">Homebrew</a> (see my <a href="https://apple.stackexchange.com/questions/98455/how-do-i-work-around-a-could-not-resolve-host-nil-error-when-installing/99040#99040">question on apple.stackexchange.com</a>), so I looked at the <a href="https://raw.github.com/mxcl/homebrew/go" rel="nofollow noreferrer">https://raw.github.com/mxcl/homebrew/go</a> Ruby script and tried the same commands it runs:</p>
  
  <pre><code>$ git init -q
  $ git remote add origin https://github.com/mxcl/homebrew
  $ git fetch origin master:refs/remotes/origin/master -n
  error: Could not resolve host: (nil); nodename nor servname provided, or not known while accessing https://github.com/mxcl/homebrew/info/refs?service=git-upload-pack
  fatal: HTTP request failed
  </code></pre>
  
  <p>Why am I getting this error?</p>
  
  <p><strong>Update:</strong> (in response to <a href="https://stackoverflow.com/users/750510/madhead">madhead</a>'s answer)</p>
  
  <p>I get the same problem when I use the URL with <strong>.git</strong> postfixed:</p>
  
  <pre><code>$ git init -q
  $ git remote add origin https://github.com/mxcl/homebrew.git
  $ git fetch origin master:refs/remotes/origin/master -n
  error: Could not resolve host: (nil); nodename nor servname provided, or not known while accessing https://github.com/mxcl/homebrew.git/info/refs?service=git-upload-pack
  fatal: HTTP request failed
  </code></pre>
  
  <p><strong>Update #2:</strong></p>
  
  <p>I don't think this was a proxy issue (as suggested in <a href="https://stackoverflow.com/users/888483/neil">neil's</a> answer).</p>
  
  <p>I tried this again and it worked!</p>
  
  <pre><code>$ git init -q
  $ git remote add origin https://github.com/mxcl/homebrew
  $ git fetch origin master:refs/remotes/origin/master -n
  remote: Counting objects: 126721, done.
  remote: Compressing objects: 100% (59085/59085), done.
  remote: Total 126721 (delta 89963), reused 100145 (delta 66623)
  Receiving objects: 100% (126721/126721), 19.68 MiB | 702 KiB/s, done.
  Resolving deltas: 100% (89963/89963), done.
  From https://github.com/mxcl/homebrew
   * [new branch]      master     -&gt; origin/master
  </code></pre>
  
  <p>I looked in my <code>~/.gitconfig</code> file and discovered I had already defined a proxy. I think that was already there when I had the problem, but to confirm I removed it and got a different error:</p>
  
  <pre><code>$ git fetch origin master:refs/remotes/origin/master -n
  error: Failed connect to github.com:443; Connection refused while accessing https://github.com/mxcl/homebrew/info/refs?service=git-upload-pack
  fatal: HTTP request failed
  </code></pre>
  
  <p>My theory is that github or homebrew had some kind of problem that they've since fixed.</p>