3 ms·
Now I'm curious -- is that here a way to do this that avoids downloading any more than strictly necessary? The command above downloads the whole repo history.
by cakoose 1y ago
Now I'm curious -- is that here a way to do this that avoids downloading any more than strictly necessary?
The command above downloads the whole repo history. You could do a depth=1 to skip the history, but it still downloads the he latest version of the entire repo tree.
- vient 1y agogit-archive downloads only strictly necessary files but is not universally supported https://git-scm.com/docs/git-archive https://git-scm.com/docs/git-archive
- craftkiller 1y agoYou could do a blobless or treeless clone https://github.blog/open-source/git/get-up-to-speed-with-partial-clone-and-shallow-clone/ https://github.blog/open-source/git/get-up-to-speed-with-par... Combined with --depth=1 and the --no-checkout / --sparse-checkout flow that the GP already described. I just tested on the emacs repo, left column is disk usage of just the `.git` folder inside: Shallow clones (depth=1): 124K: Treeless clone depth=1 with no-checkout 308K: Blobless clone depth=1 with no-checkout 12M: Treeless clone depth=1 sparse checkout of "doc" folder 12M: Blobless clone depth=1 sparse checkout of "doc" folder 53M: Treeless clone depth=1 non-sparse full checkout 53M: Blobless clone depth=1 non-sparse full checkout 53M: Regular clone with depth=1 Non-shallow clones: 54M: Treeless clone with no-checkout 124M: Blobless clone with no-checkout 65M: Treeless clone sparse checkout of "doc" folder 135M: Blobless clone sparse checkout of "doc" folder 107M: Treeless clone with non-sparse full checkout 177M: Blobless clone with non-sparse full checkout 653M: Full regular git clone with no flags Great tech talk covering some of the newer lesser-known git features: https://www.youtube.com/watch?v=aolI_Rz0ZqY https://www.youtube.com/watch?v=aolI_Rz0ZqY