git gc --prune=now

Category: Git - Advanced

git gc --prune=now

Force garbage collection immediately

Runs a full garbage collection and prunes unreferenced objects right away instead of respecting the default grace period. Any commit only reachable via the reflog or dangling objects is permanently deleted. Only run it after you are certain nothing needs recovery.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.