Git:Gc
lastmod 2026-11-10created 2017-01-042 edits
git gc is a command that optimizes a Git repository by packing loose objects into packfiles, cleaning up objects that nothing references, and compressing refs and the reflog. Dangling commits and blobs whose grace period has not yet expired are not deleted immediately, so they can be used to recover work that was deleted by mistake. Several Git commands run it automatically when needed.