Find the largest objects stored in a Git repository
Build a paste-ready command, then review its compatibility and effects before running it.
git verify-pack -v .git/objects/pack/*.idx | sort -k3 -nr | head -<count> | while read object type size rest; do echo "$size $object $(git rev-list --objects --all | rg "^$object ")"; doneComplete required fields to copy the generated command.
read-onlyno known side effects Compatibility
Linux + macOSVerified for Linux, macOS using bash, zsh syntax.
Operational knowledgereview due 2027-01-19
Requirementsgitgit must be installed and available on PATH.
Version supportgit Current supported releasesVerified for linux, macos using bash, zsh syntax; consult compatibility notes for platform-specific differences.
Expected signals73400320 19d0e4… 19d0e4… assets/demo.movRepresentative successful output; values vary with the selected target and system state.
Known errorsgit: command not foundgit is missing or is not available on PATH.
Verifygit verify-pack -v .git/objects/pack/*.idx | sort -k3 -nr | head -{{count}} | while read object type size rest; do echo "$size $object $(git rev-list --objects --all | rg "^$object ")"; doneThe output matches the expected target and exits without an error.Rollback noteNot required: this command is read-only and does not change system state.
Command breakdown
01gitCommandRuns the git stage of this one-liner.
02verify-packArgumentPasses verify-pack to git.
03-vOptionEnables verbose output for this command.
04.git/objects/pack/*.idxArgumentPasses .git/objects/pack/*.idx to git.
05|PipelinePasses the output on the left to the command on the right.
06sortCommandRuns the sort stage of this one-liner.
07-k3OptionConfigures sort with the -k3 option.
08-nrOptionConfigures sort with the -nr option.
09|PipelinePasses the output on the left to the command on the right.
10headCommandRuns the head stage of this one-liner.
11-<count>OptionConfigures head with the -<count> option.
12|PipelinePasses the output on the left to the command on the right.
13whileShell loopRepeats the following body while its condition succeeds.
14readArgumentPasses read to this command.
15objectArgumentPasses object to this command.
16typeArgumentPasses type to this command.
17sizeArgumentPasses size to this command.
18restArgumentPasses rest to this command.
19;Command separatorEnds this shell statement before the next one begins.
20doLoop bodyStarts the commands executed for each loop value.
21echoCommandRuns the echo stage of this one-liner.
22"$size $object $(git rev-list --objects --all | rg "ArgumentPasses "$size $object $(git rev-list --objects --all | rg " to echo.
23^$objectArgumentPasses ^$object to echo.
24")"ArgumentPasses ")" to echo.
25;Command separatorEnds this shell statement before the next one begins.
26doneEnd loopCloses the shell loop.
This advanced community-curated one-liner combines several stages. Review every option and placeholder before running it.
Example input
git verify-pack -v .git/objects/pack/*.idx | sort -k3 -nr | head -3 | while read object type size rest; do echo "$size $object $(git rev-list --objects --all | rg "^$object ")"; done
Example output
73400320 19d0e4… 19d0e4… assets/demo.mov
18874368 8bc7aa… 8bc7aa… fixtures/database.dump
Illustrative output — exact values vary by system and data.
Official sources