Reference: Git Cloneλ︎
clone a repository from another location, typically a shared Git service (GitHub, GitLab, etc.)
--branch
option will checkout a specific branch name once cloned.
Managing Clone sizeλ︎
Continuous Integration workflows can be more effective when cloning a small part of the repository.
Partial Cloneλ︎
--filter option
is used to clone a partial repository.
git rev-list --filter=<filter> --all
shows objects in your repository that match the filter.
Blobless clone downloads all reachable commits and trees, fetching blobs on-demand.
Use case: developers and build environments that span multiple builds.
treeless clone download all reachable commits, fetching trees and blobs on-demand.Use case: build environments where the repository will be deleted after a single build, where access to commit history is required
Shallow Cloneλ︎
A shallow clone truncate the commit history, only fetching after the specified time.
Use case: build environments where the repository will be deleted after a single build.
Shallow clones are discouraged for development as they limit git commands and may put undue stress on later fetches
Partial Clones are typically recommended over shallow clones