# deleting / adding files throughout the repository

2 messages from 2009-06-08 to 2009-06-08. Participants: Alex K, Jeff King.
Thread: https://gitlist.dev/t/19747

## Alex K, 2009-06-08 17:25

Subject: deleting / adding files throughout the repository
Message-ID: <e4a904790906081025s76bdd1a0k73003e861da98371@mail.gmail.com>
URL: https://gitlist.dev/e/e4a904790906081025s76bdd1a0k73003e861da98371%40mail.gmail.com

```
Hello,

Suppose I made a mistake in my repository. There is a file that should
never have been there. How do I delete this file from the entire
repository history? How do I add a file throughout the entire
repository history as if this later file had always been there?

Thank you,

Alex

```

## Jeff King, 2009-06-08 22:55

Subject: Re: deleting / adding files throughout the repository
Message-ID: <20090608225508.GA21389@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20090608225508.GA21389%40coredump.intra.peff.net
In-Reply-To: <e4a904790906081025s76bdd1a0k73003e861da98371@mail.gmail.com>

```
On Mon, Jun 08, 2009 at 06:25:00PM +0100, Alex K wrote:

> Suppose I made a mistake in my repository. There is a file that should
> never have been there. How do I delete this file from the entire
> repository history? How do I add a file throughout the entire
> repository history as if this later file had always been there?

Use "git filter-branch". The examples section of "git help
filter-branch" does the first part of what you're asking (and the second
part is fairly easy to extrapolate).

-Peff

```
