You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Buildkite Agent supports partial clones and sparse checkouts, which can significantly reduce clone times and disk space usage for large repositories.
4
+
5
+
## Overview
6
+
7
+
Partial clones allow you to clone a repository without downloading all of its history or objects, while sparse checkout allows you to check out only specific directories or files from a repository.
8
+
9
+
## Configuration
10
+
11
+
### Environment Variables
12
+
13
+
The following environment variables control partial clone behavior:
14
+
15
+
-`BUILDKITE_GIT_SPARSE_CHECKOUT` - Enable sparse checkout (boolean: `true` or `false`)
16
+
-`BUILDKITE_GIT_SPARSE_CHECKOUT_PATHS` - Comma-separated list of paths to include in sparse checkout
17
+
-`BUILDKITE_GIT_CLONE_DEPTH` - Clone depth for shallow clones (e.g., `200`)
18
+
-`BUILDKITE_GIT_CLONE_FILTER` - Filter specification for partial clones (e.g., `tree:0`)
19
+
20
+
### Command Line Flags
21
+
22
+
When starting an agent, you can also use command line flags:
2. **Disk Space**: Sparse checkouts reduce local disk space usage
91
+
3. **Clone Time**: Both features can dramatically reduce initial clone times
92
+
4. **Fetch Time**: Subsequent fetches will only download required objects
93
+
94
+
## Compatibility
95
+
96
+
- Requires Git 2.25.0 or later for partial clone support
97
+
- Requires Git 2.25.0 or later for cone-mode sparse checkout
98
+
- The repository must be hosted on a server that supports partial clones
99
+
100
+
## Troubleshooting
101
+
102
+
1. **Missing objects**: If you encounter "object not found" errors, you may need to adjust your filter settings or disable partial clones
103
+
2. **Sparse checkout not working**: Ensure paths are comma-separated and don't contain spaces
104
+
3. **Performance issues**: Some operations may trigger on-demand object downloads; monitor your builds to ensure partial clones provide the expected benefits
0 commit comments