`git count-objects -v` shows `garbage: 3` and `warning: garbage found: .git/objects/pack/tmp_pack_aB3dEf`.
IntermediateTroubleshootingRepository Health, Size and Performance
Answer
Likely causes → A fetch, push receive or repack was interrupted (network drop, Ctrl+C, OOM kill, full disk) and left a half-written temporary pack. These files can be very large.
Diagnose →
git count-objects -vH
ls -lh .git/objects/pack/tmp_* .git/objects/pack/*.pack
pgrep -a git # make sure nothing is still writing
Fix → With no Git process running, delete the temp files and verify:
rm -f .git/objects/pack/tmp_pack_* .git/objects/pack/tmp_idx_*
git fsck --connectivity-only
git gc also removes stale temp files older than the prune expiry.
Prevent → Fix the root cause (disk, memory, flaky network) and let scheduled maintenance run.
More on Repository Health, Size and Performance
`git status` takes 8–15 seconds in a large monorepo.Intermediate`error: The last gc run reported the following. Please correct the root cause and remove .git/gc.log` followed by `warning: There are too many unreachable loose objects; run 'git prune' to remove them.`IntermediateEvery few commands Git prints `Auto packing the repository in background for optimum performance.` and the machine stutters.BeginnerA fresh clone downloads 4 GB, but the checked-out files are only 200 MB.Intermediate`git gc` or `git clone` dies with `fatal: Out of memory, malloc failed (tried to allocate 1073741824 bytes)` or `error: pack-objects died of signal 9`.Advanced`error: unable to create temporary file: No space left on device` followed by `fatal: failed to write object`.Beginner