{"id":260,"date":"2012-01-31T19:15:02","date_gmt":"2012-02-01T00:15:02","guid":{"rendered":"http:\/\/www.compdigitec.com\/labs\/?p=260"},"modified":"2012-01-31T19:15:02","modified_gmt":"2012-02-01T00:15:02","slug":"deepen-an-existing-shallow-clone-with-git","status":"publish","type":"post","link":"http:\/\/www.compdigitec.com\/labs\/2012\/01\/31\/deepen-an-existing-shallow-clone-with-git\/","title":{"rendered":"Deepen an existing shallow clone with git"},"content":{"rendered":"<p>In git, the new revolutionary DVCS system, to shallow clone a repository means to check out only the latest snapshot of a git repository, unlike a normal clone which pulls the entire repository. A shallow git repository can save bandwidth and take up less space.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">git clone --depth=1 git:\/\/repo.example.com\/mycoolapp<\/pre>\n<p>However, let&#8217;s say that once you checkout the project, compile it and decide that you want to contribute to it, then a shallow clone would probably not suffice. In this case, one can deepen the repository by using the following command inside the git repository, where n = number of revisions to deepen to:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">git fetch --depth=n origin master<\/pre>\n<p>Saves more than having to re-clone everything from scratch and lose your working tree.<\/p>","protected":false},"excerpt":{"rendered":"<p>In git, the new revolutionary DVCS system, to shallow clone a repository means to check out only the latest snapshot of a git repository, unlike a normal clone which pulls the entire repository. A shallow git repository can save bandwidth and take up less space. However, let&#8217;s say that once you checkout the project, compile [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[215,773,771,772,774,775],"_links":{"self":[{"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/posts\/260"}],"collection":[{"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/comments?post=260"}],"version-history":[{"count":0,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/posts\/260\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/media?parent=260"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/categories?post=260"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/tags?post=260"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}