2

Until yesterday, git worked perfectly on my computer. Now, whenever I try to push, pull or clone a repository, git hangs. I've tried through both SSH and HTTPS.

Unlike a lot of other StackOverflow questions posted around this issue, my operation hangs on the same early stage.

For example, running GIT_TRACE=1 GIT_CURL_VERBOSE=1 git push origin master gives the following trace:

09:09:45.400105 git.c:418               trace: built-in: git push origin master
09:09:45.892978 run-command.c:643       trace: run_command: GIT_DIR=.git git-remote-https origin https://github.com/SOBotics/Botpy.git
* Couldn't find host github.com in the .netrc file; using defaults
*   Trying 192.30.253.112...
* TCP_NODELAY set

Without setting the debug environment variables, no messages are shown. However, when I'm cloning a repository, it shows Cloning into <name>..., and then gets stuck at the same stage in the above traceback.

Here's what I've already tried:

  • Reinstalling git through Homebrew.
  • Rebooting my computer a couple of times.
  • Disabling Pi-hole (I've been running Pi-hole since multiple months, and I never faced such an issue).
  • git config --global core.askpass "git-gui--askpass": from an answer in a similar thread. This had no affect.
  • xcode-select --reset
  • Checking whether the IP in the trace is the same as in host github.com; it is the same.
  • Tried cloning different repositories, through both HTTPS and SSH.

I'd also like to note that Homebrew updates also get stuck, probably because of the same issue. Homebrew's curl upgrade also hung. Other git functions like commit and add seem to be working fine.

I'm on macOS Mojave, running git version 2.20.1. The repositories I'm trying to push, pull and clone are all on GitHub.

Box Box Box Box
  • 5,094
  • 10
  • 49
  • 67
  • Did you check your LAN or WIFI configuration? – Carlitos Way Jan 15 '19 at 05:34
  • @CarlitosWay what specific configuration are you talking about? I haven't changed anything since a long time. – Box Box Box Box Jan 15 '19 at 15:10
  • I don't know your network setup, what I'm trying to say here is: did you do anything to discard that is a network problem (for example, if possible, plug your station directly to your adsl modem, avoiding routers or firewalls in between) – Carlitos Way Jan 15 '19 at 15:19
  • May be that is not the problem, but discarding that will help us to locate the root source ... – Carlitos Way Jan 15 '19 at 15:22
  • This is definitely a network issue of some sort. What sort, I do not know. – torek Jan 15 '19 at 18:41
  • @CarlitosWay I wasn't able to directly connect my Mac to my modem, so here's what I did: I took another Ubuntu laptop, installed git on it, and connected it to my network. Then I tried cloning the same repo which I was trying to clone on my computer, and it worked. A push and pull also seemed to work. Since another computer using the same network seemed to work with git, I guess network issues can be discarded. I also disabled the Mac firewall and tried to use git, with no success. – Box Box Box Box Jan 17 '19 at 12:15
  • cc @torek ^ (I can only ping one user per comment). – Box Box Box Box Jan 17 '19 at 12:15
  • So, we already discarded the network issue problem... Now, we can assume that the problem is in the laptop ... What happen we you `traceroute` the `github.com`domain? Can you compare the output of both equipments ? – Carlitos Way Jan 17 '19 at 21:23
  • @CarlitosWay There are some minor differences, but overall, the `traceroute` output seems to be the same. – Box Box Box Box Jan 20 '19 at 08:48
  • @CarlitosWay I've been trying to push to GitHub everyday, and surprisingly, it worked today. I'm not really sure what caused the issue. I'll post an answer if I get to the root cause. Thanks for your help! – Box Box Box Box Jan 21 '19 at 08:27
  • @CarlitosWay looks like I'm facing the problem again.... – Box Box Box Box Jan 22 '19 at 03:56
  • Wow, no clues by now ... Have you check this link: https://stackoverflow.com/questions/8750930/git-clone-hangs-forever-on-github – Carlitos Way Jan 22 '19 at 17:35

0 Answers0