# How to safely remove a blob

4 messages from 2011-02-15 to 2011-02-15. Participants: Rolf Wester, Alex Riesen, Michael J Gruber.
Thread: https://gitlist.dev/t/26506

## Rolf Wester, 2011-02-15 08:13

Subject: How to safely remove a blob
Message-ID: <4D5A358F.2050906@ilt.fraunhofer.de>
URL: https://gitlist.dev/e/4D5A358F.2050906%40ilt.fraunhofer.de

```
Hello,

in one of my git repos I found an 102 MB object that probably came in there more or less occasionally.
Its a blob and I would like to remove it safely. I tried to figure out how to do it but I was
not very successful. I guess simply deleting the file could corrupt my repo or at least the clones of
that repo.

I would be very appreciative for any help.

With kind regards
Rolf

-- 
------------------------------------
# Dr. Rolf Wester
# Fraunhofer Institut f. Lasertechnik
# Steinbachstrasse 15, D-52074 Aachen, Germany.
# Tel: + 49 (0) 241 8906 401, Fax: +49 (0) 241 8906 121
# EMail: rolf.wester@ilt.fraunhofer.de
# WWW:   http://www.ilt.fraunhofer.de

```

## Alex Riesen, 2011-02-15 08:40

Subject: Re: How to safely remove a blob
Message-ID: <AANLkTinrV3hKEva5qnaLniP+VoO2trrTVsWcc6YoBQ=t@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTinrV3hKEva5qnaLniP%2BVoO2trrTVsWcc6YoBQ%3Dt%40mail.gmail.com
In-Reply-To: <4D5A358F.2050906@ilt.fraunhofer.de>

```
On Tue, Feb 15, 2011 at 09:13, Rolf Wester
<rolf.wester@ilt.fraunhofer.de> wrote:
> in one of my git repos I found an 102 MB object that probably came in there
> more or less occasionally.
> Its a blob and I would like to remove it safely. I tried to figure out how
> to do it but I was not very successful.

Take a look at "git filter-branch". There is even an example which
does exactly this (search for "git filter-branch --tree-filter").

> I guess simply deleting the file could corrupt my repo
> or at least the clones of that repo.

The repo itself.

```

## Michael J Gruber, 2011-02-15 08:40

Subject: Re: How to safely remove a blob
Message-ID: <4D5A3C1B.2030600@drmicha.warpmail.net>
URL: https://gitlist.dev/e/4D5A3C1B.2030600%40drmicha.warpmail.net
In-Reply-To: <4D5A358F.2050906@ilt.fraunhofer.de>

```
Rolf Wester venit, vidit, dixit 15.02.2011 09:13:
> Hello,
> 
> in one of my git repos I found an 102 MB object that probably came in there more or less occasionally.
> Its a blob and I would like to remove it safely. I tried to figure out how to do it but I was
> not very successful. I guess simply deleting the file could corrupt my repo or at least the clones of
> that repo.
> 
> I would be very appreciative for any help.

If nothing references that blob then it will go away eventually. The
last section of git-filter-branch's manpage (checklist for shrinking a
repo) details the steps you can take to get rid of it now. (You should
be already in the situation after applying filter-branch and removing
refs/original/*.) If the blob still persists then it is referenced.

Michael

```

## Alex Riesen, 2011-02-15 08:42

Subject: Re: How to safely remove a blob
Message-ID: <AANLkTi=N15_2aDbw=x_m6rPWYdgwcBkn0LvmtZVt2W48@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTi%3DN15_2aDbw%3Dx_m6rPWYdgwcBkn0LvmtZVt2W48%40mail.gmail.com
In-Reply-To: <AANLkTinrV3hKEva5qnaLniP+VoO2trrTVsWcc6YoBQ=t@mail.gmail.com>

```
On Tue, Feb 15, 2011 at 09:40, Alex Riesen <raa.lkml@gmail.com> wrote:
> On Tue, Feb 15, 2011 at 09:13, Rolf Wester
> <rolf.wester@ilt.fraunhofer.de> wrote:
>> in one of my git repos I found an 102 MB object that probably came in there
>> more or less occasionally.
>> Its a blob and I would like to remove it safely. I tried to figure out how
>> to do it but I was not very successful.
>
> Take a look at "git filter-branch". There is even an example which
> does exactly this (search for "git filter-branch --tree-filter").

... search in the manpage of filter-branch. Sorry.

```
