GIT-COUNT-OBJECTS(1)

πŸ’… git-count-objects(1) πŸ’…

okay bestie, so this one's from the Git Manual and it's genuinely so underrated β€” like, everyone's out here repacking and nobody's checking the receipts first? not you tho. you're gonna count your objects like a main character. πŸŽ€


✨ NAME ✨

git-count-objects β€” counts how many unpacked objects you've got lying around, and how much disk they're eating πŸ“


🌸 SYNOPSIS 🌸

git count-objects [-v] [-H | --human-readable]

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so what this does is it counts the number of unpacked object files β€” those lil loose ones just vibing in your object database β€” plus the disk space they're consuming. and why do you care? because it literally helps you decide when it is a good time to repack. that's the whole point. vibe check your repo before you commit to the repack era. πŸ’…


✨ OPTIONS ✨

  • -v, --verbose β€” gives you the full detailed report, not just the headline number. the way that it breaks everything down?? obsessed. here's every single line it spits out:
    • count: the number of loose objects
    • size: disk space consumed by loose objects, in KiB (unless -H is specified)
    • in-pack: the number of in-pack objects
    • packs: the number of pack files
    • size-pack: disk space consumed by the packs, in KiB (unless -H is specified)
    • prune-packable: the number of loose objects that are also present in the packs. these objects could be pruned using git prune-packed.
    • garbage: the number of files in the object database that are neither valid loose objects nor valid packs πŸ—‘οΈ
    • size-garbage: disk space consumed by garbage files, in KiB (unless -H is specified)
    • alternate: absolute path of alternate object databases; may appear multiple times, one line per path. ⚠️ note that if the path contains non-printable characters, it may be surrounded by double-quotes and contain C-style backslashed escape sequences. iykyk.
  • -H, --human-readable β€” prints sizes in human readable format, so instead of doing math in your head at 2am you just get the numbers looking cute. 🫢

πŸ‘‘ GIT πŸ‘‘

Part of the git(1) suite β€” yeah, she's with the family. πŸ’œ


and that's the whole page, bestie!! slay. this was Git 2.56.0, dated 2026-09-27 β€” no cap, that's literally what it says at the bottom. go count some objects and have the day you deserve πŸŒˆβ­πŸ’–

πŸ“¦ where this page comes from