{"id":195,"date":"2016-01-04T21:16:17","date_gmt":"2016-01-04T21:16:17","guid":{"rendered":"http:\/\/fluentreports.com\/blog\/?p=195"},"modified":"2016-01-04T21:16:17","modified_gmt":"2016-01-04T21:16:17","slug":"git-submodule-and-shallow-clones","status":"publish","type":"post","link":"https:\/\/fluentreports.com\/blog\/?p=195","title":{"rendered":"Git submodule and shallow clones"},"content":{"rendered":"<p>This tip is more for my records because I am having to look up this information since it is not something I use all the time. \u00a0\u00a0 However, I hope it helps some of you too.\u00a0 You do need a recent version of git.<\/p>\n<p>If you have a submodule that has a REALLY large history and you only need the current head to build; do a simple:<br \/>\n<pre>git submodule init\ngit submodule update --depth 1<\/pre><br \/>\nTo clone to specific commit; you can do:<br \/>\n<pre>git submodule init\ncd submodule_folder\ngit fetch --depth=1 origin COMMIT_ID\ncd ..\ngit submodule update<\/pre><br \/>\nTo clone a specific tag:<br \/>\n<pre>git submodule init\ncd submodule_folder\ngit fetch --depth 1 origin refs\/tags\/TAG_NAME\ncd ..git submodule update<\/pre><br \/>\nHopefully these will save you (&amp; me) some time in the future.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This tip is more for my records because I am having to look up this information since it is not something I use all the time. \u00a0\u00a0 However, I hope it helps some of you too.\u00a0 You do need a recent version of git. If you have a submodule that has a REALLY large history&hellip; <a class=\"more-link\" href=\"https:\/\/fluentreports.com\/blog\/?p=195\">Continue reading <span class=\"screen-reader-text\">Git submodule and shallow clones<\/span><\/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":[39],"tags":[40,42,41],"class_list":["post-195","post","type-post","status-publish","format-standard","hentry","category-tips","tag-git","tag-shallow","tag-submodule","entry"],"_links":{"self":[{"href":"https:\/\/fluentreports.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/195","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fluentreports.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fluentreports.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fluentreports.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fluentreports.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=195"}],"version-history":[{"count":3,"href":"https:\/\/fluentreports.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/195\/revisions"}],"predecessor-version":[{"id":198,"href":"https:\/\/fluentreports.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/195\/revisions\/198"}],"wp:attachment":[{"href":"https:\/\/fluentreports.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=195"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fluentreports.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=195"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fluentreports.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=195"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}