git gc
git gc [--prune=<date>] [--aggressive]
Risk: Careful
What it does
Tidies the repo: packs objects and throws away ones nothing can reach.
When to use it
Rarely by hand. Git runs a light version by itself.
Example
$ git gcPack and tidy now. Objects in the reflog stay safe.
$ git gc --prune=nowDrop unreachable objects at once, with no grace time.
Learn it in: Packfiles, gc and maintenance · Official docs