# Removing old objects from partial clone

2 messages from 2023-03-28 to 2023-03-29. Participants: uzytkownik2@gmail.com, Christian Couder.
Thread: https://gitlist.dev/t/59494

## uzytkownik2@gmail.com, 2023-03-28 23:28

Subject: Removing old objects from partial clone
Message-ID: <83c29b890e7c31e0f174b8a5da22c5b20ce647da.camel@gmail.com>
URL: https://gitlist.dev/e/83c29b890e7c31e0f174b8a5da22c5b20ce647da.camel%40gmail.com

```
Hi,

I'd like to periodically remove objects which:

 - Are not reachable from newest N commits from any branch
 - Can be fetched from server if needed

Unfortunatly I work on large repo and git gc doesn't work as all
objects are still technically reachable.



```

## Christian Couder, 2023-03-29 08:51

Subject: Re: Removing old objects from partial clone
Message-ID: <CAP8UFD1SwJeAF_n=yTjrDFZg10Y7oBNiQORKSkH=USHQLVfo5g@mail.gmail.com>
URL: https://gitlist.dev/e/CAP8UFD1SwJeAF_n%3DyTjrDFZg10Y7oBNiQORKSkH%3DUSHQLVfo5g%40mail.gmail.com
In-Reply-To: <83c29b890e7c31e0f174b8a5da22c5b20ce647da.camel@gmail.com>

```
Hi,

On Wed, Mar 29, 2023 at 2:13 AM <uzytkownik2@gmail.com> wrote:
>
> Hi,
>
> I'd like to periodically remove objects which:
>
>  - Are not reachable from newest N commits from any branch
>  - Can be fetched from server if needed
>
> Unfortunatly I work on large repo and git gc doesn't work as all
> objects are still technically reachable.

John Cai and I have been working on a new `--filter` option for `git
repack` that might help you but is dangerous to use (as it could
remove objects that haven't be pushed which could corrupt the repo).

We haven't been able to get it accepted but you may still find the
discussions and code interesting.

See https://lore.kernel.org/git/20221221040446.2860985-1-christian.couder@gmail.com/

```
