Inspect what's inside a pack index.
git show-index dumps the contents of a packfile index (.idx) - object offset, SHA, and CRC for every object in the pack. It is pack forensics, nothing more.
The .idx is a sorted lookup table into a .pack. show-index reads stdin and prints one line per object so you can see what is in there without rebuilding.
git show-index [--object-format=<hash>] < <pack>.idx
Output (per line):
<offset> <sha1> (<crc32>)
Note: reads the .idx on stdin, not as an argument.
| Flag | What it does |
|---|---|
< <pack>.idx | Pipe the .idx file in via stdin (no positional arg) |
--object-format=<hash> | Hash algorithm of the index: sha1 (default) or sha256 |
git show-index < .git/objects/pack/pack-abcd1234.idxgit show-index < .git/objects/pack/pack-abcd1234.idx | grep <sha>git show-index < .git/objects/pack/pack-abcd1234.idx | wc -lgit show-index --object-format=sha256 < .git/objects/pack/pack-xxxx.idxgit verify-pack -v first - it is friendlier and shows object types and sizes.git show-index foo.idx will hang or error.Hit each option, then Check answers. Score is recorded; Next is always open.