| English | 中文 |
Shallow clone only fetches partial history.
Use for CI, temporary checks, and quickly downloading repositories. Avoid using it when complete historical analysis is required.
Only pull the latest commit:
git clone --depth 1 <url>
Only pull shallow history for a specific branch:
git clone --depth 1 --branch main <url>
git blamegit bisectIf full history is needed later:
git fetch --unshallow
Shallow clone reduces history depth.
Partial clone reduces object downloads.
They solve different problems and can be used in combination, but verify support from your Git version and hosting platform.