{"thread":{"id":"19747","subject":"deleting / adding files throughout the repository","startedAt":"2009-06-08T17:25:00Z","lastAt":"2009-06-08T22:55:08Z","messageCount":2,"participants":["Alex K","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"115823","messageId":"e4a904790906081025s76bdd1a0k73003e861da98371@mail.gmail.com","threadId":"19747","inReplyTo":null,"subject":"deleting / adding files throughout the repository","fromName":"Alex K","fromEmail":"spaceoutlet@gmail.com","sentAt":"2009-06-08T17:25:00Z","receivedAt":"2009-06-08T17:25:00Z","isPatch":false,"sender":{"key":"spaceoutlet@gmail.com","avatar":null},"body":"Hello,\n\nSuppose I made a mistake in my repository. There is a file that should\nnever have been there. How do I delete this file from the entire\nrepository history? How do I add a file throughout the entire\nrepository history as if this later file had always been there?\n\nThank you,\n\nAlex\n"},{"id":"115857","messageId":"20090608225508.GA21389@coredump.intra.peff.net","threadId":"19747","inReplyTo":"e4a904790906081025s76bdd1a0k73003e861da98371@mail.gmail.com","subject":"Re: deleting / adding files throughout the repository","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-06-08T22:55:08Z","receivedAt":"2009-06-08T22:55:08Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Jun 08, 2009 at 06:25:00PM +0100, Alex K wrote:\n\n> Suppose I made a mistake in my repository. There is a file that should\n> never have been there. How do I delete this file from the entire\n> repository history? How do I add a file throughout the entire\n> repository history as if this later file had always been there?\n\nUse \"git filter-branch\". The examples section of \"git help\nfilter-branch\" does the first part of what you're asking (and the second\npart is fairly easy to extrapolate).\n\n-Peff\n"}]}