I have not been able to find a definitive answer.
I have always assumed that Netlify performs a full-depth clone of repositories, and I have no evidence to suggest otherwise. But I would appreciate a confirmation of my assumption.
Thanks much.
I have not been able to find a definitive answer.
I have always assumed that Netlify performs a full-depth clone of repositories, and I have no evidence to suggest otherwise. But I would appreciate a confirmation of my assumption.
Thanks much.
hi @jmooring
Our clones are not shallow but we do perform a blobless clone which makes it even faster.
Hope this helps!
Thank you for the confirmation. Much appreciated.
Hi @gualter
I’m curious, what made you choose a blobless clone by default instead of a treeless clone?
Hi, @slorber. I will not have the time to track down all stakeholders in that decision to get their reasoning for why that decision was made. However, the blog post @gualter linked to above has clues. Quoting that blog post:
Quick Summary
There are three ways to reduce clone sizes for repositories hosted by GitHub.
git clone --filter=blob:none <url>
creates a blobless clone. These clones download all reachable commits and trees while fetching blobs on-demand. These clones are best for developers and build environments that span multiple builds.git clone --filter=tree:0 <url>
creates a treeless clone. These clones download all reachable commits while fetching trees and blobs on-demand. These clones are best for build environments where the repository will be deleted after a single build, but you still need access to commit history.git clone --depth=1 <url>
creates a shallow clone. These clones truncate the commit history to reduce the clone size. This creates some unexpected behavior issues, limiting which Git commands are possible. These clones also put undue stress on later fetches, so they are strongly discouraged for developer use. They are helpful for some build environments where the repository will be deleted after a single build.
Above the shallow clone is strongly discouraged and the treeless clone is only recommended if the repo will be deleted after each build (which is not the case at Netlify).
At Netlify, the cloned repo is preserved and reused via the build cache for subsequent builds. Above it say that the blobless clone is “best for developers and build environments that span multiple builds” which is the case at Netlify.
To summarize, we are following the same recommendations made in the blog post above.