SafeDisk AI

Git background task storage incident

Background git fetch tmp_pack Disk Full

When an editor, AI coding tool, or desktop Git integration runs git fetch in the background and kills it after a short timeout, Git can leave partial .git/objects/pack/tmp_pack_* files behind. If the same doomed fetch repeats every few seconds, the repository never catches up and disk usage grows until the drive fills.

Ask free AI judgment

Find what you can delete.

Leave your email now. The scan summary can follow after the first reply; we send the free SafeDisk AI deletion trial step only if deletion risk is still unclear.

Add command output optional

Free trial step. We reply first with a delete / confirm / protect judgment or one read-only detail we still need.

See sample result Ask AI about one file

Confirm the Failure Mode

First prove the disk growth is partial fetch packs, not normal Git history. Run the check from the affected repository root.

Read-only first pass

Measure tmp_pack files and live Git processes.

This command does not delete anything. It shows the Git directory, object garbage, pack directory size, partial pack files, and any currently running fetch or index-pack process.

repo="${PWD}"
git -C "$repo" rev-parse --git-dir --show-toplevel 2>/dev/null
git -C "$repo" count-objects -vH 2>/dev/null

gitdir=$(git -C "$repo" rev-parse --git-dir 2>/dev/null)
if [ -n "$gitdir" ]; then
  du -sh "$gitdir/objects/pack" 2>/dev/null || true
  find "$gitdir/objects/pack" -maxdepth 1 -type f -name "tmp_pack_*" -print0 2>/dev/null \
    | xargs -0 ls -lh 2>/dev/null \
    | tail -40
fi

pgrep -af "git.*fetch|git.*index-pack|git.*remote" 2>/dev/null || true

Emergency Cleanup Boundary

Only remove partial pack files after every background Git process for that repository is stopped. If an app keeps launching a fetch every 15 seconds, cleanup alone will not hold.

  1. Quit the app or disable the background upstream-status poller.
  2. Confirm no matching git fetch, git index-pack, or git remote process is still running.
  3. Preserve the count and total size of tmp_pack_* files for the bug report.
  4. Remove only .git/objects/pack/tmp_pack_* files, not .pack, .idx, .promisor, refs, logs, or the whole .git directory.
  5. Run one foreground git fetch --no-tags origin to completion so the next status check has a small delta.

Product Fix Contract

The durable fix needs two parts: cleanup after killed fetches and a loop breaker when the initial catch-up fetch cannot fit the short status timeout.

Copy-ready issue reply

Use this when background fetch leaks tmp_pack files.

This keeps the reply focused on the recovery boundary and the product-side fix.

I would treat this as two bugs sharing one symptom:

1. Timeout cleanup: when the status fetch is killed or exits non-zero, remove only the tmp_pack_* files created by that specific attempt.
2. Loop breaker: once a fetch timeout happens, do not retry the same full backlog every short refresh interval. Enter a degraded/stale upstream state, back off, or run one longer catch-up fetch.

For recovery, I would ask users to stop the app/background poller first, confirm no git fetch/index-pack is live, capture:

git count-objects -vH
du -sh .git/objects/pack
find .git/objects/pack -maxdepth 1 -type f -name 'tmp_pack_*' | wc -l

Then remove only .git/objects/pack/tmp_pack_* and run one foreground git fetch to completion. I would avoid any guidance that deletes .git/objects/pack/*.pack, refs, logs, or the whole repository.

Do Not Delete First

Free AI deletion trial

Need a delete / confirm / protect answer?

Send the issue link, log excerpt, or storage summary first. We reply with the next safe move and offer the free SafeDisk AI deletion trial only if the incident still needs review.

Add output optional

Start with email. Output can follow after the first reply.