--- title: Optimize the local repository tags: repository,advanced --- Optimizes the local repository. - Use `git gc --prune=now --aggressive` to garbage collect loose objects. ```shell git gc --prune=now --aggressive ``` ```shell git gc --prune=now --aggressive # Optimizes the local repository ```