Synthèse
git-clone(1) has this feature called partial clone. This allows the user to apply a filter to what is sent over from the server. In practice, this is done with the --filter option. For example: git clone --filter=blob:none This will clone the repository, but that clone excludes all blobs (i.e. the contents of the files in the tree). This can speed up the clone tremendously, but it comes at the cost that Git needs to download blobs later when other commands are used that read file conten
git-clone(1) has this feature called partial clone. This allows the user to apply a filter to what is sent over from the server. In practice, this is done with the --filter option. For example: git clone --filter=blob:none This will clone the repository, but that clone excludes all blobs (i. e.
the contents of the files in the tree). This can speed up the clone tremendously, but it comes at the cost that Git needs to download blobs later when other commands are used that read file contents. And some commands might need a lot of missing blobs. git-grep(1) is one of those commands, as it searches the content of the files. To do so, it obviously needs to have those files.
Imagine you want to search the word "TODO" 100 commits back in history: This command resolves the HEAD~100 commit and the trees associated with that. But those trees might point to blobs that aren't downloaded yet. Previously, each blob was downloaded separately. But that is improved in Git 2. 55.
In this version of Git, the blob downloads are batched together into a single negotiating round-trip with the server. This batching is now implemented for both git-grep(1) and git-cherry(1). This change was submitted by Elijah Newren.
Source originale
git-scm.com