Use after a suspicious push/clone to confirm sanity.
git verify-pack walks a packfile via its index and confirms each object's checksum and chain. Run it after a suspicious push, clone, or disk scare to prove the pack is intact.
Reads pack-XXXX.idx, then re-checksums every object in pack-XXXX.pack, following delta chains. If anything mismatches, it errors. With -v, it prints per-object size, type, and chain depth.
git verify-pack [-v|--verbose] [-s|--stat-only] <pack>.idx ...| Flag | What it does |
|---|---|
<pack>.idx | Required: path to the .idx file (the .pack must sit beside it). |
-v, --verbose | Print one line per object: SHA, type, size, offset, depth, base. |
-s, --stat-only | Print only the summary (counts, deltas, chain depth) - no per-object output. |
(no flag) | Verify silently; exit 0 on success, non-zero on corruption. |
git verify-pack .git/objects/pack/pack-abcd1234.idxgit verify-pack -s .git/objects/pack/pack-abcd1234.idxgit verify-pack -v .git/objects/pack/pack-abcd1234.idx | headgit verify-pack -v .git/objects/pack/*.idx | awk '$5 ~ /^[0-9]+$/ {print $5}' | sort -n | tailHit each option, then Check answers. Score is recorded; Next is always open.