Skip to content

Document why the repository is large and how to shrink a clone - #1078

Merged
jklare merged 1 commit into
mainfrom
readme-git-repository-size
Aug 26, 2026
Merged

Document why the repository is large and how to shrink a clone#1078
jklare merged 1 commit into
mainfrom
readme-git-repository-size

Conversation

@berendt

@berendt berendt commented Aug 26, 2026

Copy link
Copy Markdown
Member

A full clone of this repository uses around 500 MB of disk space, which is surprising for a documentation site whose source tree is a few MB. Nothing in the working tree explains it, so this adds a Repository Size section to the README that does.

The cause is the gh-pages branch. The deploy workflow pushes the complete rendered site there on every build, and 391515 of the 399118 objects in the pack belong to that branch alone, 98% of the repository. The two Docusaurus search indexes account for roughly 270 MB across 1582 stored versions: they are minified JSON with regenerated term IDs, so nearly the whole file changes per build and Git cannot store the versions as small deltas. The rendered HTML under docs/ and de/docs/ adds another 145 MB.

Nobody working on the site needs gh-pages locally, so the section gives both ways to avoid it, either dropping the remote-tracking ref and repacking an existing clone, or cloning with --single-branch from the start. Both leave the clone at around 20 MB, measured with a --single-branch clone of main.

The negative refspec that keeps git fetch from restoring the branch needs Git 2.29 or newer, and the section says so along with how to undo it. It also states that this is local only, so that nobody reads the instructions as a change that would break GitHub Pages.

README only, no site content and no workflow is touched.

A full clone uses around 500 MB of disk space, which is surprising for a
documentation site whose source tree is a few MB. The cause is not
obvious from the working tree: the deploy workflow pushes the complete
rendered site to gh-pages on every build, and 391515 of the 399118
objects in the pack belong to that branch alone. The two Docusaurus
search indexes are the largest part, roughly 270 MB across 1582 stored
versions, because they are minified JSON with regenerated term IDs and
therefore do not delta-compress between builds.

Nobody working on the site needs gh-pages locally, so the README now
describes both ways to avoid it: dropping the remote-tracking ref and
repacking an existing clone, or cloning with --single-branch in the
first place. Either one leaves the clone at around 20 MB, measured with
a --single-branch clone of main.

The negative refspec that keeps git fetch from restoring the branch
needs Git 2.29 or newer, and the section says so, along with how to
undo it. It also states that this is local only, so that nobody reads
the instructions as a change that would break GitHub Pages.

Assisted-by: Claude:claude-opus-5[1m]
Signed-off-by: Christian Berendt <berendt@osism.tech>
@berendt berendt moved this from New to Ready for review in Human Board Aug 26, 2026
@berendt
berendt requested a review from jklare August 26, 2026 07:48
@github-actions

Copy link
Copy Markdown

⚠️MegaLinter analysis: Success with warnings

Descriptor Linter Files Fixed Errors Max errors Warnings Elapsed time
✅ ACTION actionlint 5 0 0 0.04s
✅ JSON jsonlint 4 0 0 0.08s
✅ JSON prettier 4 0 0 0.26s
✅ JSON v8r 4 0 0 8.19s
✅ MARKDOWN markdownlint 169 0 0 1.54s
✅ MARKDOWN markdown-table-formatter 169 0 0 0.22s
✅ REPOSITORY betterleaks yes no no 0.49s
✅ REPOSITORY checkov yes no no 18.77s
✅ REPOSITORY git_diff yes no no 0.04s
✅ REPOSITORY secretlint yes no no 2.36s
✅ REPOSITORY trufflehog yes no no 3.35s
✅ SPELL codespell 179 0 0 0.4s
⚠️ SPELL lychee 179 1 0 37.9s
✅ YAML prettier 6 0 0 0.25s
✅ YAML v8r 6 0 0 5.31s
✅ YAML yamllint 6 0 0 0.69s

Detailed Issues

⚠️ SPELL / lychee - 1 error
📝 Summary
---------------------
🔍 Total.........1082
🔗 Unique.........823
✅ Successful....1007
⏳ Timeouts.........3
🔀 Redirected.......5
👻 Excluded........71
❓ Unknown..........0
🚫 Errors...........1
⛔ Unsupported......1

Errors in docs/guides/deploy-guide/services/openstack.md
[TIMEOUT] https://www.openstack.org/software/project-navigator/openstack-components#openstack-services (at 14:5) | Request timed out

Errors in docs/release-notes/osism-10.md
[ERROR] https://gateway-api.sigs.k8s.io/ (at 842:3) | Connection failed. Check network connectivity and firewall settings

Errors in docs/release-notes/osism-7.md
[TIMEOUT] https://www.openstack.org/software/openstack-bobcat (at 978:38) | Request timed out

Errors in docs/release-notes/osism-8.md
[TIMEOUT] https://www.openstack.org/software/openstack-caracal (at 223:38) | Request timed out

Hint: Followed 5 redirects. You might want to consider replacing redirecting URLs with the resolved URLs. Use verbose mode (`-v`/`-vv`) to see redirection details.

See detailed reports in MegaLinter artifacts

Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining FLAVOR_SUGGESTIONS: false)

  • Documentation: Custom Flavors
  • Command: npx mega-linter-runner@10.0.0 --custom-flavor-setup --custom-flavor-linters ACTION_ACTIONLINT,JSON_JSONLINT,JSON_V8R,JSON_PRETTIER,MARKDOWN_MARKDOWNLINT,MARKDOWN_MARKDOWN_TABLE_FORMATTER,REPOSITORY_CHECKOV,REPOSITORY_GIT_DIFF,REPOSITORY_BETTERLEAKS,REPOSITORY_SECRETLINT,REPOSITORY_TRUFFLEHOG,SPELL_LYCHEE,SPELL_CODESPELL,YAML_PRETTIER,YAML_YAMLLINT,YAML_V8R

MegaLinter is provided by OX Security
Show us your support by starring ⭐ the repository

@berendt berendt self-assigned this Aug 26, 2026
@berendt berendt moved this from Ready for review to In review in Human Board Aug 26, 2026

@jklare jklare left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@jklare
jklare merged commit b0fd6a0 into main Aug 26, 2026
4 checks passed
@jklare
jklare deleted the readme-git-repository-size branch August 26, 2026 09:10
@github-project-automation github-project-automation Bot moved this from In review to Done in Human Board Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants