{"id":455,"date":"2018-11-16T11:00:18","date_gmt":"2018-11-16T03:00:18","guid":{"rendered":"https:\/\/play.datalude.com\/blog\/?p=455"},"modified":"2018-11-16T11:01:28","modified_gmt":"2018-11-16T03:01:28","slug":"git-pull-stopped-working","status":"publish","type":"post","link":"https:\/\/play.datalude.com\/blog\/2018\/11\/git-pull-stopped-working\/","title":{"rendered":"Git pull stopped working"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">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<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">fatal: unable to connect to github.com:<br>github.com[0: 140.82.118.4]: errno=Connection refused<br>github.com[1: 140.82.118.3]: errno=Connection refused<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">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.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> Nov 15 12:20:42 DST=140.82.118.4 PROTO=TCP DPT=9418\n Nov 15 12:20:43 DST=140.82.118.4 PROTO=TCP DPT=9418\n Nov 15 12:20:43 DST=140.82.118.3 PROTO=TCP DPT=9418\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">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:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>[remote \"origin\"]\n        url = https:\/\/github.com\/repo\/repo.git\n        # url = git:\/\/github.com\/repo\/repo.git\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">And now my <strong>git pull<\/strong> works again.&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 github.com:github.com[0: 140.82.118.4]: errno=Connection refusedgithub.com[1: 140.82.118.3]: errno=Connection refused Uh-oh. Thinking it might be a transient error, I left it for a while. But then &#8230; <a title=\"Git pull stopped working\" class=\"read-more\" href=\"https:\/\/play.datalude.com\/blog\/2018\/11\/git-pull-stopped-working\/\" aria-label=\"Read more about Git pull stopped working\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[1],"tags":[134,135],"class_list":["post-455","post","type-post","status-publish","format-standard","hentry","category-it","tag-linux","tag-security"],"_links":{"self":[{"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/posts\/455","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/comments?post=455"}],"version-history":[{"count":0,"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/posts\/455\/revisions"}],"wp:attachment":[{"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/media?parent=455"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/categories?post=455"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/tags?post=455"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}