{"id":67877,"date":"2023-11-01T09:29:45","date_gmt":"2023-11-01T17:29:45","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/devops\/?p=67877"},"modified":"2023-12-08T09:41:53","modified_gmt":"2023-12-08T17:41:53","slug":"git-partial-clone-now-supported-in-azure-devops","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/devops\/git-partial-clone-now-supported-in-azure-devops\/","title":{"rendered":"Git Partial Clone Now Supported in Azure DevOps"},"content":{"rendered":"<h2>Git Partial Clone<\/h2>\n<p>Treeless and blobless Git Partial Clones are now enabled in Azure DevOps for all customers! Partial clones are a reduced type of git clone that users create via specific arguments on the git command line. For large repositories with a lot of history, they offer a dramatic performance improvement compared to a regular clone, with some tradeoffs. Partial clones do not download every single historical object in the repository at clone time like a traditional clone. Instead, they delay downloading many objects until checkout of a branch (or other git scenario) that needs them. Those who want a deeper understanding of what blob and tree objects are and what this tradeoff means should read <a href=\"https:\/\/github.blog\/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone\/\" rel=\"noopener\" target=\"_blank\">this GitHub blog post<\/a>.<\/p>\n<h2>How To Use<\/h2>\n<p>This feature ONLY affects git clones\/fetches that pass these arguments. Blob size limits are not yet supported, and attempting to specify those will result in the clone request failing at this time. These are the supported commands:<\/p>\n<p>Blobless clones: <code>git clone --filter=blob:none &lt;url&gt;<\/code><\/p>\n<p>Treeless clones: <code>git clone --filter=tree:0 &lt;url&gt;<\/code><\/p>\n<h2>Performance Benefit<\/h2>\n<p>Partial clones show a large performance benefit over traditional clones, benefitting large repositories the most. We&#8217;re seeing an average 88.6% reduction in clone time in repositories where it&#8217;s used. The very largest of those repositories enjoy a >99% reduction in clone time.<\/p>\n<p>Many build pipelines may see a speed benefit from using partial clone. Also, partial clone is suitable for developer machines that need a fast clone, or need to prioritize disk space.<\/p>\n<h2>Partial != Shallow<\/h2>\n<p>At first glance this feature may seem similar to the shallow clone feature <code>git clone --depth=1 &lt;url&gt;<\/code>, which Azure DevOps already supported. Although shallow clones are even faster than partial clones, they leave the user with a flattened git commit history with commit history only up to a certain point, and no awareness of history before that. Therefore, shallow clones are typically used in specific scenarios such as a build pipeline that doesn&#8217;t look at history.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Git Partial Clone Treeless and blobless Git Partial Clones are now enabled in Azure DevOps for all customers! Partial clones are a reduced type of git clone that users create via specific arguments on the git command line. For large repositories with a lot of history, they offer a dramatic performance improvement compared to a [&hellip;]<\/p>\n","protected":false},"author":132857,"featured_media":52701,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[224,226,1,225],"tags":[],"class_list":["post-67877","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-azure","category-ci","category-devops","category-git"],"acf":[],"blog_post_summary":"<p>Git Partial Clone Treeless and blobless Git Partial Clones are now enabled in Azure DevOps for all customers! Partial clones are a reduced type of git clone that users create via specific arguments on the git command line. For large repositories with a lot of history, they offer a dramatic performance improvement compared to a [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/67877","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/users\/132857"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/comments?post=67877"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/67877\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media\/52701"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media?parent=67877"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/categories?post=67877"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/tags?post=67877"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}