{"id":1523,"date":"2016-02-02T14:33:43","date_gmt":"2016-02-02T21:33:43","guid":{"rendered":"http:\/\/10kdev.net\/?p=1523"},"modified":"2016-02-02T14:33:43","modified_gmt":"2016-02-02T21:33:43","slug":"so-your-git-repo-moved","status":"publish","type":"post","link":"http:\/\/10kdev.net\/?p=1523","title":{"rendered":"So . . . Your Git Repo Moved"},"content":{"rendered":"<p><a href=\"http:\/\/10kdev.net\/wp-content\/uploads\/2016\/02\/dd653bd83023ebcce74dd7cc6a1e4916.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter\" src=\"http:\/\/10kdev.net\/wp-content\/uploads\/2016\/02\/dd653bd83023ebcce74dd7cc6a1e4916.png\" alt=\"\" width=\"606\" height=\"144\" \/><\/a><\/p>\n<p>Sometimes &#8220;they&#8221; move the location of your git repository. \u00a0Seems to be happening a lot in my last few years of coding.<\/p>\n<p>There are a few ways to deal with this moving, but it is important to remember that git is very, very good at a move situation since every commit is unique and it&#8217;s distributed nature lends itself to using different locations.<\/p>\n<p>The DevOps team sent out instructions for us to deal with change, including &#8220;check everything in, make sure you are up to date&#8221; etc. \u00a0Prudent but not necessary. \u00a0They sent a command line method out for the change and even renamed the repository for some reason.<\/p>\n<p>(That rename\u00a0did not need to be done for our use case, but certainly you could. Although, since they did change our repo name *and* we are all still located in on our original local directory &#8220;oldreponame&#8221;\u00a0\u00a0I am not sure what will eventually play out. Niiiice.)<\/p>\n<p>Well here were\u00a0their marching orders:<\/p>\n<p style=\"padding-left: 30px;\"><em>git remote set-url origin https:\/\/&lt;username&gt;@bitbucket.org\/newrepolocation\/newreponame.git<\/em><br \/>\n<em> git remote set-url &#8211;push origin https:\/\/&lt;username&gt;@bitbucket.org\/newrepolocation\/newreponame.git<\/em><\/p>\n<p>Always good to know git command line stuff, no doubt.<\/p>\n<p>Myself? Well I&#8217;m a ragtime guy. I just opened up \/.git\/config and changed this entry:<\/p>\n<p style=\"padding-left: 30px;\"><em>[remote &#8220;origin&#8221;]<\/em><br \/>\n<strong><em> url = https:\/\/&lt;username&gt;@bitbucket.org\/oldrepolocation\/oldreponame.git<\/em><\/strong><br \/>\n<em> fetch = +refs\/heads\/*:refs\/remotes\/origin\/*<\/em><\/p>\n<p>to this:<\/p>\n<p style=\"padding-left: 30px;\"><em>[remote &#8220;origin&#8221;]<\/em><br \/>\n<strong><em> url = https:\/\/&lt;username&gt;@bitbucket.org\/newrepolocation\/newreponame.git<\/em><\/strong><br \/>\n<em> fetch = +refs\/heads\/*:refs\/remotes\/origin\/*<\/em><\/p>\n<p>Badabingo.<\/p>\n<p>I didn&#8217;t tell DevOps though.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes &#8220;they&#8221; move the location of your git repository. \u00a0Seems to be happening a lot in my last few years of coding. There are a few ways to deal with this moving, but it is important to remember that git is very, very good at a move situation since every commit is unique and it&#8217;s [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts\/1523"}],"collection":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1523"}],"version-history":[{"count":3,"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts\/1523\/revisions"}],"predecessor-version":[{"id":1526,"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts\/1523\/revisions\/1526"}],"wp:attachment":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1523"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1523"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1523"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}