Skip to content

Reclaim ~1.5 GB of git history without breaking the image CDN #265

Description

@McCal-Codes

The pack is 2.65 GB. HEAD holds 1.09 GB across 3,664 images; the rest is superseded and deleted blobs.

The June audit recommended adding src/images/Portfolios/** to .gitignore and purging. That would take every gallery offline — jsDelivr serves the images straight from this repo at @main (useManifest.ts:5). The bloat is load-bearing, which is why the item never moved.

Nothing pins a commit SHA — every consumer uses @main or @manifests-cdn — so history can be rewritten provided the files still exist at HEAD.

Approach: git filter-repo --path src/images/Portfolios --invert-paths, then re-add the current images in one commit. History keeps exactly one version of each image; HEAD stays byte-identical, so jsDelivr keeps serving.

  1. Recompress the oversized originals first, so the re-add commit contains fixed files
  2. Full mirror backup — filter-repo needs --force on an existing checkout
  3. git filter-repo --analyze to confirm before rewriting
  4. Rewrite, re-add, git gc --aggressive --prune=now, verify the HEAD tree hash is unchanged
  5. Coordinate the force-push: it invalidates open PRs and every clone must be re-cloned
  6. Verify jsDelivr immediately after, using its purge endpoint rather than waiting for branch caches
  7. Add *.drive-stuck and desktop.ini to .gitignore (both tracked today); delete the stale .git-rewrite/

Remote size will not drop until GitHub's own GC runs.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions