Skip to content

Commit f5fa809

Browse files
authored
Merge pull request timvink#160 from timvink/119-document-how-to-use-sparse-checkouts
Add tips to speed up builds
2 parents 46f4daf + 7b6edf1 commit f5fa809

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

.github/workflows/pythonpublish.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ jobs:
1717
- uses: actions/checkout@v4
1818
with:
1919
fetch-depth: '0'
20+
sparse-checkout: |
21+
docs
22+
includes
2023
- name: Set up Python
2124
uses: actions/setup-python@v5
2225
with:

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,18 @@ This plugin needs access to the last commit that touched a specific file to be a
5050
- Bitbucket pipelines: set `clone: depth: full` (<a href="https://support.atlassian.com/bitbucket-cloud/docs/configure-bitbucket-pipelinesyml/">docs</a>)</li>
5151
- Azure Devops pipelines: set `Agent.Source.Git.ShallowFetchDepth` to something very high like `10e99` ([docs](https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/pipeline-options-for-git?view=azure-devops#shallow-fetch))
5252

53+
*Tip*: You can speed up your builds for large codebases by running git garbage collection (`git gc`) occasionly. You can also use _sparse checkouts_ to only apply the fetch-depth 0 for the folders we're interested (credits Martin [in this tweet](https://x.com/squidfunk/status/1705279829770150291)):
54+
55+
```yaml
56+
# example sparse checkout for github actions
57+
- uses: actions/checkout@v4
58+
with:
59+
fetch-depth: 0
60+
sparse-checkout: |
61+
docs
62+
includes
63+
```
64+
5365
## Documentation
5466

5567
See [timvink.github.io/mkdocs-git-revision-date-localized-plugin](https://timvink.github.io/mkdocs-git-revision-date-localized-plugin/index.html).

0 commit comments

Comments
 (0)