Published Feb 14, 2025
[
 
]
git clone --depth <depth> <repo-url>
--depth 1
: Only fetch the latest commit.git clone --depth 1 https://github.com/example/repo.git
git clone --filter=<filter> <repo-url>
--filter=blob:none
: Skips all blobs (file contents) and only downloads them when accessed.git clone --filter=blob:none https://github.com/example/repo.git
Aspect | Shallow Clone | Partial Clone |
---|---|---|
Focus | Limited commit history | Skipping large blobs |
Speed | Faster for small history clones | Faster for repos with large objects |
Dis Space | Save space by reducing hisotry | Save space by delaying blob downloads |
Operations Limit | Some opraions may not be supported | All operations are supported |