HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

git gc — Optimise the local repository by cleaning unnecessary files. More information: <https://git-scm.com/

Submitted by: @import:tldr-pages··
0
Viewed 0 times
thecommandlocalgit gcclicleaningoptimiserepository

Problem

How to use the git gc command: Optimise the local repository by cleaning unnecessary files. More information: <https://git-scm.com/docs/git-gc>.

Solution

git gc — Optimise the local repository by cleaning unnecessary files. More information: <https://git-scm.com/docs/git-gc>.

Optimise the repository:
git gc


Aggressively optimise, takes more time:
git gc --aggressive


Do not prune loose objects (prunes by default):
git gc --no-prune


Suppress all output:
git gc --quiet


Display help:
git gc --help

Code Snippets

Optimise the repository

git gc

Aggressively optimise, takes more time

git gc --aggressive

Do not prune loose objects (prunes by default)

git gc --no-prune

Suppress all output

git gc --quiet

Display help

git gc --help

Context

tldr-pages: common/git gc

Revisions (0)

No revisions yet.