# What is the difference between git-gc, git-repack and git-prune?

2 messages from 2008-05-07 to 2008-05-07. Participants: DigitalPig, Avery Pennarun.
Thread: https://gitlist.dev/t/13405

## DigitalPig, 2008-05-07 02:44

Subject: What is the difference between git-gc, git-repack and git-prune?
Message-ID: <873aoux284.fsf@gmail.com>
URL: https://gitlist.dev/e/873aoux284.fsf%40gmail.com

```
Hi!

For git-prune, according to the manual, it will delete all the dangling
objects. So it is easy to understand. However, in the git-gc manpage,
there is another option named "--prune". Does that make git-gc do the
same thing as git-prune?

And manpage of git-gc says it cleans unnecessary files and compresses
the objects, and git-repack also compresses the objects too. Are there
any difference between these two operations? Or do I need to invoke
git-repack after running git-gc? Thanks!


Zhenqing

-- 
DigitalPig
E-mail: digitalpiglee AT gmail DOT com
ALL WE SEEN IS ILLUSION.

*Fudan University Macromoleculer Science Forum*
http://fudanmacro.com

```

## Avery Pennarun, 2008-05-07 02:53

Subject: Re: What is the difference between git-gc, git-repack and git-prune?
Message-ID: <32541b130805061953s7ef38990r44d9966af0c8d9ea@mail.gmail.com>
URL: https://gitlist.dev/e/32541b130805061953s7ef38990r44d9966af0c8d9ea%40mail.gmail.com
In-Reply-To: <873aoux284.fsf@gmail.com>

```
On 5/6/08, DigitalPig <digitalpiglee@gmail.com> wrote:
>  For git-prune, according to the manual, it will delete all the dangling
>  objects. So it is easy to understand. However, in the git-gc manpage,
>  there is another option named "--prune". Does that make git-gc do the
>  same thing as git-prune?
>
>  And manpage of git-gc says it cleans unnecessary files and compresses
>  the objects, and git-repack also compresses the objects too. Are there
>  any difference between these two operations? Or do I need to invoke
>  git-repack after running git-gc? Thanks!

git-gc is a fancy wrapper that automatically calls git-repack and
git-prune for you with the most commonly used options, so you usually
don't need to run the others yourself.

Avery

```
