threads / discuss / 62825

Erase a commit from a git repository

Subject: Erase a commit from a git repository

## tl;dr

3 messages between Jan 18, 2025 and Jan 21, 2025.

replies: 2people: 3as markdown or json

Tim Tassonis· Jan 18, 2025, 20:50 UTC · lore
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· Jan 19, 2025, 11:21 UTC · re: Tim Tassonis · lore

Re: Erase a commit from a git repository

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· Jan 21, 2025, 17:30 UTC · re: Tim Tassonis · lore

Re: Erase a commit from a git repository

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?

← back to recent threads