On a GitHub-hosted Linux runner, the default checkout took between 1.2 and 18 seconds on six public repositories, and fetch-depth: 0 took between 3 and 163 seconds. A partial clone took about half of that or less on five of the six but made later git commands slow, a sparse checkout of one directory took 1.1 to 3.3 seconds, and recursive submodules took 76 seconds on grpc and 181 on pytorch. All are medians of ten runs. Every input is in our actions/checkout guide.
- The default checkout took 1.2 to 18 seconds on six public repositories; fetch-depth: 0 took 3 to 163 seconds.
- A partial clone took about half of that or less on five of six, but git blame stopped at 60 seconds with tree:0 on every repository.
- A sparse checkout of one directory took 1.1 to 3.3 seconds, and does not pay where that directory is most of the repository.
- Recursive submodules took 76 seconds on grpc and 181 on pytorch; submodules: true took about half of that.
- Medians of ten runs on GitHub-hosted ubuntu-24.04, one day, one image; the rows are in a public repository.
We timed actions/checkout v7.0.1 with each setting on six repositories chosen by a rule, plus two repositories with submodules, in a public repository where anyone can read the workflow and the rows. The method is below the results. The numbers are seconds on one runner image on one day. They are not a comparison with anything, and your repository will not match any of them; the point is how the settings rank.
How long does a checkout take, by setting?
Each cell is the median of ten fresh runners, in seconds, with the slowest of the ten in brackets. With ten runs the tail is one run, so we show it as what it is: the slowest of the ten. The first column names the repository, its language and where it sits in the rule’s size ranking.
| Repository | Default (depth 1) | fetch-depth: 0 | 0 and filter: blob:none | 0 and filter: tree:0 | sparse-checkout |
|---|---|---|---|---|---|
| graphify (Python, median) | 1.5 (2.3) | 3.0 (4.1) | 2.1 (2.6) | 2.3 (3.8) | 1.2 (2.3) |
| langchain (Python, 90th percentile) | 2.3 (2.6) | 20.1 (22.3) | 5.9 (8.3) | 4.5 (5.8) | 3.3 (4.3) |
| syncthing (Go, median) | 1.2 (1.7) | 4.6 (7.3) | 1.7 (3.1) | 2.4 (3.2) | 1.1 (1.3) |
| go (Go, 90th percentile) | 6.1 (7.4) | 29.2 (39.1) | 13.1 (19.9) | 9.9 (11.4) | 1.4 (2.1) |
| immich (TypeScript, median) | 3.3 (5.2) | 10.9 (17.1) | 5.3 (6.9) | 5.0 (7.1) | 1.1 (1.6) |
| orca (TypeScript, 90th percentile) | 18.0 (35.7) | 163 (395) | 67.3 (93.2) | 30.7 (46.9) | 1.5 (2.0) |
fetch-depth: 0 was the slowest setting on all six, and the gap to the default tends to grow with the repository’s history: 1.5 against 3.0 seconds on graphify, 18.0 against 163 on orca. A sparse checkout was the fastest on five of six, and on langchain, where it is not, the next section says why. The time of a default checkout is also not steady on every repository: one of ten orca runs took 35.7 seconds against a median of 18.0.
The empty control cell, in which the checkout step is skipped, took 0.01 to 0.03 seconds on every run. That is the cost of our two clock readings and a step boundary, so it is not hiding a second of overhead in the other cells.
What each setting leaves on disk
The size of the .git directory in MiB (1,024 x 1,024 bytes, as du reports it), from the same runs. The working tree was the same size in every cell except the sparse one.
| Repository | Default | fetch-depth: 0 | 0 and blob:none | 0 and tree:0 | sparse-checkout |
|---|---|---|---|---|---|
| graphify | 13 | 40 | 17 | 16 | 10 |
| langchain | 19 | 647 | 78 | 55 | 18 |
| syncthing | 6 | 131 | 18 | 12 | 2 |
| go | 40 | 486 | 153 | 78 | 3 |
| immich | 50 | 330 | 80 | 63 | 1 |
| orca | 101 | 2,870 | 533 | 317 | 7 |
This is size on disk, not bytes over the network, which we did not capture. It is a fair guide to the history that came down: orca’s .git is 2,870 MiB with full history and 533 MiB with blob:none.
What does the time not show?
After each checkout we ran three commands that a build might: git describe --tags --abbrev=0, git diff --shortstat HEAD~1 HEAD and git blame on the first 40 lines of a README. On the default checkout, describe and diff failed on all six repositories, with git’s exit code 128: the clone has one commit and no tags. Every depth-0 checkout, filtered or not, passed both. So a job that reads tags or the previous commit needs depth, and the answer to “can I use fetch-depth: 1” is that you can until a step asks git a question about history.
The partial clones are where the checkout time misleads. With blob:none the fetch leaves out the file contents of old commits (the checkout still fetches the files it writes), and tree:0 also leaves out the directory listings of old commits. Git fetches what is missing from GitHub when a command needs it. git blame needs them for every commit that touched the lines:
| Repository | fetch-depth: 0 | 0 and blob:none | 0 and tree:0 |
|---|---|---|---|
| graphify | 0.1 s | 6 of 10 stopped at 60 s | all 10 stopped at 60 s |
| langchain | 0.2 s | 2.5 s | all 10 stopped at 60 s |
| syncthing | 0.0 s | 2.5 s | all 10 stopped at 60 s |
| go | 0.6 s | 6.0 s | all 10 stopped at 60 s |
| immich | 0.1 s | 29.7 s | all 10 stopped at 60 s |
| orca | 0.2 s | 0.7 s | all 10 stopped at 60 s |
On tree:0, blame did not finish in 60 seconds on any repository in any run, and we stopped it. On blob:none the median was 0.7 seconds on orca and 29.7 on immich, and on graphify 6 of 10 runs did not finish in 60 seconds. The cost of a partial clone is moved from the checkout step to whichever step asks first, and a tool that walks history, such as blame or a log of a file, pays it one object at a time. Use a filter for a job that needs commits and tags but not their contents, such as computing a version with git describe. Do not use one for a job that reads file history.
# version from tags: history and tags, almost no file contents
- uses: actions/checkout@v7
with:
fetch-depth: 0
filter: blob:none
- run: git describe --tags --abbrev=0
What does a sparse checkout save, and when does it not?
A sparse checkout took 1.1 to 1.5 seconds on five of the six repositories, whatever their size, because it writes a few directories and the root files and fetches only the file contents it writes. On orca it left 19 files of 34,862 on disk and took 1.5 seconds against 18.0 for the default. The exception shows the trap: our rule picks the first directory by name, which on langchain is libs, the directory that holds nearly all of it. That sparse checkout wrote 3,115 of 3,300 files and took 3.3 seconds, about a second more than the default, probably because the action’s code fetches a sparse checkout without file contents and then fetches the ones it writes. A sparse checkout pays only when the directories you ask for are a small part of the repository.
- uses: actions/checkout@v7
with:
sparse-checkout: |
backend
shared
A sparse checkout is depth 1 unless you also set fetch-depth, so it has the same failure as the default for tools that read history. Our reference to every input covers its cone and non-cone modes.
What do submodules cost?
| Repository | Default: no submodules | submodules: true | submodules: recursive |
|---|---|---|---|
| grpc (20 submodules) | 4.8 (5.4); 10,770 files, 112 MiB | 41.5 (54.4); 37,149 files, 655 MiB | 76.0 (89.9); 57,176 files, 889 MiB |
| pytorch (34 submodules) | 6.0 (15.9); 22,429 files, 276 MiB | 92.8 (106); 80,130 files, 1,351 MiB | 181 (216); 146,546 files, 2,789 MiB |
Submodules are the most expensive setting in the study. On grpc, submodules: true took 41.5 seconds and took the working tree from 10,770 files to 37,149; recursive took 76.0 and 57,176 files. On pytorch it was 92.8 and 181 seconds, and 22,429 files grew to 80,130 and then 146,546. If the job builds with only some of the submodules, check out the ones it needs in a later step with git submodule update --init and a path; we did not time that.
What should you set?
Leave the default unless a step needs more, and when it does, add exactly what it needs. This is our reading of the tables, and the table is the evidence for it:
| The job | Set | From the measurements |
|---|---|---|
| Builds and tests the commit, no history | the default | 1.2 to 18 s on the six repositories. |
| Builds one directory of a large repository | sparse-checkout: the directory | 1.1 to 1.5 s on five of six; no gain where the directory is most of the repository. |
| Reads tags or computes a version, no blame or log of files | fetch-depth: 0 with filter: blob:none | Half or less of the time of 0 alone on five of six; git describe passed everywhere. |
| Reads file history: blame, log, a changelog of files | fetch-depth: 0, no filter | A filter moved the cost into the command: blame stopped at 60 s with tree:0 on every repository. |
| Needs submodules | submodules: true if the submodules do not nest | About half the time of recursive on both repositories. |
How we measured, and what we did not
Each cell was one job on a fresh ubuntu-24.04 runner on 17 November 2026, ten per cell, started in a random order, with two clock readings on either side of a single checkout step and every cell pinned to one commit. The six repositories are, for Python, Go and TypeScript, the one at the median and the one at the 90th percentile of size among the thirty most-starred public repositories, after dropping those with no licence, archived ones and ones with no push in the last 90 days; the rule and the table are in the METHOD file. The two submodule repositories were chosen because they have many submodules. The rows, with each run’s date and ID, are in studies/A2-checkout-cost.
Things this does not tell you. It is one runner image release (two builds of it) on one day, and GitHub’s network varies. Every cell is a first fetch on a new machine, so it says nothing about a checkout that finds anything cached. We did not capture bytes over the network, only size on disk. We timed Linux only. And the sparse directory was picked by a rule, not by what a build needs, which is why langchain is a bad case on purpose.
For what each input does, and what changed between v4 and v7, see the reference. The guide to making GitHub Actions faster puts checkout among the other levers, and the checkout cache is our own answer to the same download, documented there. The workflow checker flags a deep checkout in a workflow you paste in. Build times measured on GitHub’s runner and on ours are on our faster GitHub Actions runners, measured page.
Sources
- ci-measurements, study A2: what a checkout costs (github.com)
- actions/checkout action.yml at v7.0.1 (github.com)
- actions/checkout git-source-provider.ts at v7.0.1 (github.com)
- git clone documentation (git-scm.com)
Frequently asked questions
How long does actions/checkout take?
On a GitHub-hosted Linux runner the default took a median of 1.2 to 18 seconds on six public repositories, and fetch-depth: 0 took 3 to 163 seconds. The default's spread tracks how many files a repository has and the depth-0 spread its history; six repositories cannot separate the two.
Does fetch-depth 1 make a checkout faster?
It is the default, and the fastest way to get all the files. It leaves one commit and no tags, so git describe and a diff against the previous commit failed with exit code 128 on all six repositories.
Is filter blob:none safe to use?
It kept history and tags, and git describe worked. The cost moved: git blame took a median of 0.7 to 29.7 seconds on five repositories, did not finish in 60 seconds in 6 of 10 runs on a sixth, and with tree:0 stopped on every run.
How long do submodules take to check out?
On grpc, with 20 submodules, submodules: true took a median of 41.5 seconds and recursive 76.0. On pytorch, with 34, they took 92.8 and 181 seconds, against 4.8 and 6.0 without submodules.