{"id":171,"date":"2020-06-29T17:45:05","date_gmt":"2020-06-29T20:45:05","guid":{"rendered":"https:\/\/vargolino.com\/wp\/?p=171"},"modified":"2020-06-29T17:49:46","modified_gmt":"2020-06-29T20:49:46","slug":"accessing-corporate-git-repositories-without-a-vpn","status":"publish","type":"post","link":"https:\/\/vargolino.com\/wp\/?p=171","title":{"rendered":"Accessing corporate GIT repositories without a VPN"},"content":{"rendered":"\n<p style=\"font-size:16px\">I usually just write here so I can remember these things later, but this time is something to be found by others.<\/p>\n\n\n\n<p>So, it is normal to have our git repositories accessible in the public internet (access controlled or not), but it is possible that your repositories are only accessible within your corporate network, and you would need to be inside the company or use a VPN to be able to use it.<\/p>\n\n\n\n<p>One of the ways that this can be circumvented is to use a port forward with an SSH connection, when updating some web app in an outside development environment, for example.<\/p>\n\n\n\n<p>Port forward is straightforward:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ssh user@remote_host -R 10443:git.company.com:443<\/pre>\n\n\n\n<p>this will listen for local requests to port <code>10443<\/code> inside <code>remote_host<\/code> and redirect them trough the SSH connection to <code>git.company.com:443<\/code>. <\/p>\n\n\n\n<p>This way it should be easy to clone, pull and push directly to the centralized repository<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">git clone https:\/\/localhost:10443\/path_to\/repository.git<\/pre>\n\n\n\n<p>And that&#8217;s it.<\/p>\n\n\n\n<p>Of course you will need to be using a computer that is able to access the repository, either from inside or using a VPN, but the development environment does not need to.<\/p>\n\n\n\n<p>In time, maybe check with the company&#8217;s IT department if it&#8217;s OK to do this! \ud83d\ude09<\/p>\n\n\n\n<p>Hope this is useful for someone!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I usually just write here so I can remember these things later, but this time is something to be found by others. So, it is normal to have our git repositories accessible in the public internet (access controlled or not), but it is possible that your repositories are only accessible within your corporate network, and &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/vargolino.com\/wp\/?p=171\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Accessing corporate GIT repositories without a VPN&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[19,7],"class_list":["post-171","post","type-post","status-publish","format-standard","hentry","category-solution","tag-git","tag-howto","entry"],"_links":{"self":[{"href":"https:\/\/vargolino.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/171","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vargolino.com\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vargolino.com\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vargolino.com\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vargolino.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=171"}],"version-history":[{"count":2,"href":"https:\/\/vargolino.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/171\/revisions"}],"predecessor-version":[{"id":174,"href":"https:\/\/vargolino.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/171\/revisions\/174"}],"wp:attachment":[{"href":"https:\/\/vargolino.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=171"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vargolino.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=171"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vargolino.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=171"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}