Progress:
TIER 3 · MODULE 36· Expert

git pack-redundant

Helps shrink an over-packed repo. Deprecated in newer Gits.

🎯 What & why

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.

🧠 Mental model

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.

🛠️ Synopsis

git pack-redundant --all [--alt-odb] [--verbose] [<pack-file>...]

🎚️ Switches & options

FlagWhat it does
--allConsider every pack in the local object store (typical use).
--alt-odbAlso consult alternate object databases (shared object stores).
--verbosePrint 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.

💡 Use cases

🧪 Examples

Find redundant packs
git pack-redundant --all
Verbose audit
git pack-redundant --all --verbose
Pipe results to removal
git pack-redundant --all | xargs -r rm -f
Modern replacement
git repack -ad --write-bitmap-index

🎓 Recommendations

🪤 Common pitfalls

🔗 Related modules

📝 Quiz

Hit each option, then Check answers. Score is recorded; Next is always open.