Git · Maintenance

git gc

Compresses loose objects and prunes unreachable ones.

Syntax
git gc

Example

Example
git gc --aggressive

More in this group

git count-objects -v git filter-repo git fsck --lost-found git lfs git maintenance git prune git reflog expire git repack

Learn this in the course

Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.

Open the course