blobpurge

command
v0.167.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2026 License: BSD-3-Clause Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

blobpurge removes blobs from a repository's history BY ID, and proves what the rewrite did before anybody pushes it.

blobpurge scan [-min 512KiB] <git-dir>
blobpurge strip -blob <id> [-blob <id> ...] -to <new-git-dir> <git-dir>

scan lists every blob at least -min bytes that some branch or tag reaches and that HEAD's tree no longer holds: a binary committed by mistake and deleted since, still cloned by everybody. Beside each one it names the TAGS whose trees hold it, because those are the released trees a rewrite will change.

strip writes the rewritten history into a NEW repository, so the original is untouched whatever happens, and then checks every branch and tag against it: the same refs, the same number of commits, the same authors, committers, dates and messages, and a tree equal to the old one minus exactly the stripped blobs. It does not push. Pushing a rewritten main is an act somebody takes on purpose, after reading what this printed.

It strips by blob ID, never by path, because a path names every version of a file: stripping `bridge` would also strip a later, legitimate file of that name. And it refuses a blob HEAD still holds: delete it in a reviewed commit first, so the current tree is already right before history is touched. A tree that does not hold the blob comes out byte-identical, which is what keeps the module hash of every release made after the deletion unchanged.

It replaces a `git filter-branch --index-filter` recipe whose filter was a shell script, ran once per commit, and whose only check was whatever its operator remembered to run afterwards.

The history is read through `git fast-export --show-original-ids`, which names every blob by its original ID, and written by `git fast-import`. Both ship with git. Commit signatures cannot survive a rewrite, since a signature covers the parent IDs, so they are stripped and the count is reported.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL