Helps shrink an over-packed repo. Deprecated in newer Gits.
Find packfiles whose objects are all already present in other packs, so you can delete them and shrink the repo. Note: deprecated in modern Git in favour of incremental repack with proper bitmap support.
Over time git push/fetch drop in many small packs that overlap. pack-redundant does set-difference math across .pack files and reports the ones whose contents are fully covered elsewhere. Modern Git prefers repack -d (and --geometric) which knows about bitmaps; reach for pack-redundant only on legacy repos.
git pack-redundant --all [--alt-odb] [--verbose] [<pack-file>...]| Flag | What it does |
|---|---|
--all | Consider every pack in the local object store (typical use). |
--alt-odb | Also consult alternate object databases (shared object stores). |
--verbose | Print per-pack progress and object counts on stderr. |
<pack-file>... | Restrict the analysis to a specific list of pack files. |
| ⚠️ No --dry-run: output is just a list; deletion is your responsibility downstream. |
git gc has not been run for a long time.repack --geometric.git pack-redundant --allgit pack-redundant --all --verbosegit pack-redundant --all | xargs -r rm -fgit repack -ad --write-bitmap-indexgit repack -ad (or --geometric=<n>) plus git gc; let Git decide what is redundant.pack-redundant, take a backup or run on a clone first; deleting the wrong pack corrupts the repo..pack files; you must remove the matching .idx (and .rev/.bitmap) files too, or Git will complain.--alt-odb it ignores shared alternates and may flag packs whose objects only exist via the alternate.Hit each option, then Check answers. Score is recorded; Next is always open.