3

After installing Git from Homebrew I cannot working with remote repositories:

$ brew install git
$ git --version
git version 2.3.0
$ git pull
fatal: unable to access 'https://github.com/...': Couldn't connect to server

If I will remove Homebrew version all works fine.

How can I use the last git version to work with remote repositories?

Update:

I can clone the repository using SSH (git@github.com:...), but have the error with HTTPS urls (https://github.com/...)

Update:

$ git config -l

Andrey Demidov, [07.02.15 23:48]
push.default=simple
user.name=Andrey Demidov
user.email=****@gmail.com
mergetool.keepbackup=false
http.sslverify=false
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
core.precomposeunicode=true
remote.origin.url=https://github.com/demas/stackify-node.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master

Update:

$ GIT_CURL_VERBOSE=1 git push

stackify/node » GIT_CURL_VERBOSE=1 git push ‹master›
* Couldn't find host github.com in the .netrc file; using defaults
* Hostname was NOT found in DNS cache
* Trying 192.30.252.130...
* Immediate connect fail for 192.30.252.130: Host is down
* Closing connection 0
fatal: unable to access 'https://github.com/demas/stackify-node.git/': Couldn't connect to server

Update:

Here is a traceroute result:

stackify/node » traceroute github.com ‹master›
traceroute to github.com (192.30.252.130), 64 hops max, 52 byte packets
load: 1.24 cmd: traceroute 34029 waiting 0.00u 0.00s
load: 1.24 cmd: traceroute 34029 waiting 0.00u 0.00s
load: 1.24 cmd: traceroute 34029 waiting 0.00u 0.00s
 1 192.168.1.1 (192.168.1.1) 3.571 ms 3.022 ms 2.565 ms
 2 bras255-lo0.ppos.corbina.net (195.14.38.33) 3.427 ms 4.671 ms 3.899 ms
 3 * * *
 4 ko-crs-be5.corbina.net (195.14.54.184) 23.766 ms 24.413 ms 25.010 ms
 5 tc-bb-ae0.sto.corbina.net (195.14.54.157) 22.168 ms 21.946 ms 22.328 ms
 6 beeline-gw6.bar1.stockholm1.level3.net (213.242.69.13) 22.280 ms
 beeline-gw7.bar1.stockholm1.level3.net (213.242.110.217) 23.015 ms
 beeline-gw1.bar1.stockholm1.level3.net (213.242.110.9) 23.303 ms
 7 ae-3-80.edge3.washington4.level3.net (4.69.149.146) 138.533 ms
 ae-4-90.edge3.washington4.level3.net (4.69.149.210) 150.283 ms *

Update:

  • All Git commands work fine in standard OSX console application
  • All Git commands work fine if I use them with sudo in iTerm.
  • But I have the problem only in iTerm without sudo command
ceth
  • 44,198
  • 62
  • 180
  • 289
  • Would http://stackoverflow.com/a/21181447/6309 help? – VonC Feb 07 '15 at 20:27
  • Hmm.... I don't use Gitlab – ceth Feb 07 '15 at 20:28
  • sure, replace gitlab by github.com in your case. – VonC Feb 07 '15 at 20:29
  • `git config --global http.sslverify false` didn't fix the problem – ceth Feb 07 '15 at 20:31
  • Just to check, could you replace the github url returned by `git remote -v` with one using https? `git remote set-url origin https://github.com/...`. And try to `git pull` again after that. – VonC Feb 07 '15 at 20:32
  • I have already url's with https – ceth Feb 07 '15 at 20:34
  • Ok (that wasn't obvious from the error message in your question, hence my question) – VonC Feb 07 '15 at 20:35
  • But your question give me a hint. I have checked and I see that I can clone the repositories using SSH (git@github....), but have the problem with https repositories (https://....). – ceth Feb 07 '15 at 20:37
  • Are you behind a proxy? (as in https://github.com/Homebrew/homebrew/issues/35356)? – VonC Feb 07 '15 at 20:38
  • If you have the error with https, why the error message shows an error with http? `fatal: unable to access 'http://github.com/...` – VonC Feb 07 '15 at 20:39
  • No, I don't use proxy. It was my mistake (http) - I fix it and update the question. – ceth Feb 07 '15 at 20:41
  • just in case, with `git` installed through homebrew, what does `git config -l` return? Do you see any line including "`proxy`" in that output? – VonC Feb 07 '15 at 20:46
  • I have updated my question. I don't see anything about proxy. – ceth Feb 07 '15 at 20:49
  • I have update my question one more time and include the result of `$ GIT_CURL_VERBOSE=1 git push`. May be it will help to find the answer. – ceth Feb 07 '15 at 20:55
  • Can you try a `git remote set-url origin https://demas@github.com/demas/stackify-node`, and see what `GIT_CURL_VERBOSE=1 git push` returns? – VonC Feb 07 '15 at 21:16
  • I have the same error message with slightly different url. But I have found that all git commands works fine if I use them with 'sudo' ! – ceth Feb 07 '15 at 21:24
  • Hmm... and more detail. I have the problem only with iTerm. I have no problem (even without sudo) with standard console application... – ceth Feb 07 '15 at 21:31
  • Would that work better with iTerm2 (http://iterm2.com/) instead of iTerm? – VonC Feb 07 '15 at 21:39
  • 1
    Yes, I have donwloaded nightly build of iTerm and all works fine! Thanks. – ceth Feb 07 '15 at 21:39

1 Answers1

2

I have the problem only with iTerm.
I have no problem (even without sudo) with standard console application

Apparently, it was a case of an obsolete iTerm version. It might work better with iTerm2, but the OP adds:

I have downloaded nightly build of iTerm and all works fine!

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250