# Erase a commit from a git repository

3 messages from 2025-01-18 to 2025-01-21. Participants: Tim Tassonis, Reto, Junio C Hamano.
Thread: https://gitlist.dev/t/62825

## Tim Tassonis, 2025-01-18 20:50

Subject: Erase a commit from a git repository
Message-ID: <db7ea8df-2f37-47b9-828b-67b8d3068232@decentral.ch>
URL: https://gitlist.dev/e/db7ea8df-2f37-47b9-828b-67b8d3068232%40decentral.ch

```
Hi all

Sorry if this is the wrong list, I have a question regarding a faulty 
commit that costs me quite a lot of diskspace.

I accidentally committed an pushed one gigabyte of firmware blobs into 
one of my git repositories, and noticed that too late, e.g. it was 
already on master and newer commits had occurred.

To my knowledge, there is no easy way to remove a commit out of an 
existing repository.

But I assume that there is a way around this: As one can easily migrate 
an svn repository to git with all history included, there surely is also 
a way to "migrate" a git repository to another git repository in the 
same way and then just leave that commit out.

As this sounds like quite a lot of manual work, I wondered if there is 
an automated process for this?

Bye
Tim



```

## Reto, 2025-01-19 11:21

Subject: Re: Erase a commit from a git repository
Message-ID: <lyk3ps7h36bld6jh2uptzzdxpikjdjxnhcenc22rpaqobzw3ct@u22qnfbquwmi>
URL: https://gitlist.dev/e/lyk3ps7h36bld6jh2uptzzdxpikjdjxnhcenc22rpaqobzw3ct%40u22qnfbquwmi
In-Reply-To: <db7ea8df-2f37-47b9-828b-67b8d3068232@decentral.ch>

```
On Sat, Jan 18, 2025 at 09:50:31PM +0100, Tim Tassonis wrote:
> As this sounds like quite a lot of manual work, I wondered if there is an
> automated process for this?

Sure: https://github.com/newren/git-filter-repo

```

## Junio C Hamano, 2025-01-21 17:30

Subject: Re: Erase a commit from a git repository
Message-ID: <xmqqa5bk2hwx.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqa5bk2hwx.fsf%40gitster.g
In-Reply-To: <db7ea8df-2f37-47b9-828b-67b8d3068232@decentral.ch>

```
Tim Tassonis <stuff@decentral.ch> writes:

> As this sounds like quite a lot of manual work, I wondered if there is
> an automated process for this?


https://github.com/newren/git-filter-repo perhaps?

```
