By admin , 29 April 2026

Synopsis

git verify-pack [-v] [--stat-only] <pack>.idx

Description

The git verify-pack command checks the integrity of a packfile and its index, verifying SHA-1 checksums and delta chain consistency. With -v, it prints the list of objects in the pack along with type, size, and (for deltas) base information.

In day-to-day use, git verify-pack integrates closely with shell aliases, editor plugins, and continuous integration. Power users often add aliases that combine flags they always pass, or wrap the command in scripts that enforce team conventions. Output formatting can be customized via Git config — pretty formats, color schemes, and pager behavior are all tunable. When something goes wrong, the first diagnostic step is usually to re-run the command with GIT_TRACE=1 in the environment, which reveals the underlying plumbing calls. For unusual situations, the --help output (git verify-pack --help) opens the full manual page with details on every option, including those rarely used in casual workflows but essential for debugging or scripting at scale.

Understanding how git verify-pack interacts with the rest of Git's data model — the object database, the index, refs, and the working tree — pays dividends. Each command operates on some subset of these pieces, and knowing which it touches helps predict outcomes and recover from mistakes. Reading the official Git documentation alongside hands-on practice in a throwaway repository is the fastest way to internalize the nuances. Most production issues with Git stem from one of three causes: surprising default behavior, partial network operations, or rewriting history that was already shared. A working mental model of git verify-pack's side effects helps avoid all three.

When to Use

Most users never run this. It's invaluable for repository forensics — finding which large blobs are eating space, understanding delta chain health, or diagnosing corruption.

Common Options

OptionDescription
-vVerbose: list every object.
--stat-onlyShow summary statistics only.
-O <file>Read pack-list from file.

Examples

git verify-pack -v .git/objects/pack/pack-*.idx
# Detailed listing of objects in every pack

# Find the biggest blobs in the repository:
git verify-pack -v .git/objects/pack/*.idx | \
  sort -k 3 -n | tail -20

git verify-pack --stat-only .git/objects/pack/pack-*.idx
# Summary stats per pack

Common Mistakes

Pointing at a .pack instead of .idx fails — always pass the index. Sorting verify-pack output to find big files works, but don't forget to also examine loose objects with git count-objects -v.

Related Commands

git fsck, git gc, git repack, git count-objects