threads / discuss / 19747

deleting / adding files throughout the repository

Subject: deleting / adding files throughout the repository

## tl;dr

2 messages between Jun 8, 2009 and Jun 8, 2009.

replies: 1people: 2as markdown or json

Alex K· Jun 8, 2009, 17:25 UTC · lore
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· Jun 8, 2009, 22:55 UTC · re: Alex K · lore

Re: deleting / adding files throughout the repository

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

← back to recent threads