Git pull stopped working

So this is a weird one. I’d previously grabbed some code from a git repository. But recently when I went to update it, I got an error

fatal: unable to connect to[0:]: errno=Connection refused[1:]: errno=Connection refused

Uh-oh. Thinking it might be a transient error, I left it for a while. But then when I got the report from my firewall logs, I saw some outbound connection attempts which it was blocking.

 Nov 15 12:20:42 DST= PROTO=TCP DPT=9418
 Nov 15 12:20:43 DST= PROTO=TCP DPT=9418
 Nov 15 12:20:43 DST= PROTO=TCP DPT=9418

So googling around I saw that this port was related to a proprietary git protocol, and then I connected the two events. So apparently the last time I checked out the code, it had used the default git protocol. Then I installed a firewall with egress filtering on the server, so now it was blocking the connection attempts. One solution would be to add tcp/9418 to my firewall rules, but there was actually a simpler way. From the code directory I edited the .git/config file and changed the url= line:

[remote "origin"]
        url =
        # url = git://

And now my git pull works again. 

Leave a Comment