GIT-PACK-REDUNDANT(1)

πŸ’… GIT-PACK-REDUNDANT(1) β€” the girlies' guide to git-pack-redundant

okay so bestie, welcome to the git manual page for git-pack-redundant ✨ you found it, you're here, let's get into it 🫢


✨ NAME ✨

git-pack-redundant β€” find redundant pack files πŸ” like, it goes looking for packs that are literally extra


πŸŽ€ SYNOPSIS πŸŽ€

git pack-redundant [--verbose] [--alt-odb] (--all | <pack-filename>...)

that's the whole vibe, no cap πŸ’…


πŸ’€ WARNING πŸ’€

okay so this is the part where I have to be a little serious with you 😭

git pack-redundant has been deprecated and is scheduled for removal in a future version of Git. like. it's on the way out, bestie. and here's why, because the reason matters:

it can only remove entire duplicate packs β€” not individual duplicate objects. so it's generally not a useful tool for reducing repository size. that's the whole point of the thing and it can't really do it, which is giving… not slay 🫠

you're way better off using git gc to do this, which will put objects into a new pack, removing duplicates. git gc ate and left no crumbs, honestly πŸ‘‘

also important: running pack-redundant without the --i-still-use-this flag will fail in this release ⚠️ like, it just won't run. that's a real thing, not a bit.

and hey β€” if you genuinely believe you have a use case for which pack-redundant is better suited, and you oppose this removal, please contact the Git mailing list at git@vger.kernel.org[1]. more info about the list is available at https://git-scm.com/community πŸ’Œ they want to hear from you fr fr


🌸 DESCRIPTION 🌸

so what does this program do? it computes which packs in your repository are redundant. that's it, that's the job πŸŽ€

the output is suitable for piping to xargs rm β€” if you are in the root of the repository. (read that again, the root, bestie, don't come for me later πŸ™ˆ)

git pack-redundant accepts a list of objects on standard input. any objects given will be ignored when checking which packs are required. and that is what makes the following command so useful when you want to remove packs which contain unreachable objects ✨:

git fsck --full --unreachable | cut -d ' ' -f3 | \ git pack-redundant --all | xargs rm

it's giving pipeline main character energy 🌈


πŸ’– OPTIONS πŸ’–

  • --all β€” processes all packs. any filenames on the command line are ignored. like, don't even bother typing them, she's not listening πŸ’…
  • --alt-odb β€” don't require objects present in packs from alternate object database (odb) directories to be present in local packs. so she's chill about the alt odb situation πŸ¦‹
  • --verbose β€” outputs some statistics to stderr. has a small performance penalty. worth it for the tea, honestly β˜• but yes, it costs you a lil performance, keep it real

πŸ¦‹ SEE ALSO πŸ¦‹

the whole friend group πŸ’œ


πŸ‘‘ GIT πŸ‘‘

part of the git(1) suite ✨ she's family


πŸ“ NOTES πŸ“

  1. git@vger.kernel.org mailto:git@vger.kernel.org

okay that's the page!! πŸ’– this was written for Git 2.56.0, dated 2026-09-27 β€” like, remember that date, it's on the tag 🏷️ and yeah, it's GIT-PACK-REDUNDANT(1), the icon that she is πŸ’…βœ¨ go use git gc though, fr fr 🫢

πŸ“¦ where this page comes from