Repository Size Cleanup
This page records the 2026-04-04 cleanup analysis. The active code_review/
tree no longer exists; its retained local material is under
.planning/archive/code_review/. Do not execute the history-rewrite commands
from this page as a current task without a new, explicit repository-maintenance
decision.
Historical state
Local inspection on 2026-04-04 found:
.gitsize: about1.4G- packed objects: about
1.35 GiB - loose objects:
0 - garbage objects:
0
This means the size is in committed history, not in disposable local Git metadata.
Largest historical contributors found so far:
results/: about635 MiB.Rlib/: about444 MiB.cache/: about279 MiBassets/: about183 MiBcode_review/: about125 MiB
Largest file classes found so far:
.rds: about1.0 GiB.pdf: about184 MiB.a: about131 MiB.so: about118 MiB
At that snapshot, the main tracking gap was
code_review/benchmarks/**/cache/, which was versioned in HEAD.
Goal
Reduce future repository growth immediately, then decide separately whether to rewrite history to shrink existing clones.
Phase 1: Stop future growth
This phase is low risk and should be merged first.
Ignore rules
The repository should ignore:
/.Rlib//.cache//results//code_review/benchmarks/**/cache//assets/books/
/.Rlib/, /.cache/, and /results/ were already ignored before this note. The new additions are:
/code_review/benchmarks/**/cache//assets/books/
Remove cached benchmark artifacts from Git index
This removes tracked cache files from HEAD without deleting the local copies:
Current tracked files that should be removed from the index:
Validation after Phase 1
Run:
Expected result:
- benchmark cache files are ignored
- local cache files remain on disk
- repository history size does not materially shrink yet
Phase 2: Shrink existing history
This phase is disruptive and should only happen after coordination with every collaborator and any external services that clone this repository.
Safety rules
- Freeze merges to
mainduring the rewrite window. - Ask every collaborator to stop pushing until the rewrite is complete.
- Create a backup mirror before modifying history.
- Use a temporary clone or mirror for the rewrite, not an active working copy.
Suggested backup
Suggested rewrite target set
Remove historical content for paths that are local caches or generated outputs:
/.Rlib/**/.cache/**/results/**/code_review/benchmarks/**/cache/**/assets/books/**
Suggested workflow with git filter-repo
Use a fresh mirror clone:
Then verify size:
Publish rewritten history
Only after verification:
If branch protections block force-pushes, temporarily adjust them before the rewrite window and restore them immediately after.
Collaborator recovery after rewrite
Every collaborator should re-clone. If someone must salvage local work, they should:
Re-cloning is still safer than trying to reuse an old clone after a large rewrite.
Phase 3: Optional future hardening
If large binary artifacts must remain versioned in future, move them to Git LFS. Do not use Git LFS for ephemeral caches, run outputs, or package libraries that should stay untracked.
Recommended order
- Merge the
.gitignorechange. - Remove tracked benchmark cache files from the index with
git rm --cached. - Confirm local validation and documentation checks still pass.
- Decide whether the current
1.4G.gitsize justifies a history rewrite. - If yes, schedule a short maintenance window and perform the rewrite from a mirror clone.