git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Removing some files from history

From
Jeff King <peff@peff.net>
Date
Oct 17, 2008, 10:42 UTC
Message-ID
<20081017104243.GA15848@sigill.intra.peff.net>
In-Reply-To
<96ed5eac0810170338s292fe858s1c092428a44a7ad2@mail.gmail.com>
On Fri, Oct 17, 2008 at 02:38:54PM +0400, Gennady Kushnir wrote:
> I'm going to make my repository public, but I have found that one of
> my files contains some private data that I would not like to share.
> Is it possible to remove that file from all commits in my local
> repository history before publishing it?

Yes, see "git help filter-branch". The first example given does exactly what you are asking for.

-Peff
Previous: Gennady KushnirNext: Michael J Gruber
Message 2 of 5 in “Removing some files from history”
  1. Gennady KushnirOct 17, 2008
  2. Jeff KingOct 17, 2008
  3. Michael J GruberOct 17, 2008
  4. Gennady KushnirOct 17, 2008
  5. Jakub NarebskiOct 17, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.