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

Re: Really remove a file ?

From
Alex Riesen <raa.lkml@gmail.com>
Date
Oct 9, 2008, 18:56 UTC
Message-ID
<81b0412b0810091156v15dea27an95050a06cfb4f8df@mail.gmail.com>
In-Reply-To
<8CAF851B91FEF07-660-20E9@webmail-da15.sysops.aol.com>
2008/10/9  <marcreddist@aim.com>:
> So is there a way to really remove a file in the git repository so that it
> never existed (I mean not having the diff in the logs and the data stored
> somewhere in the .git directory) ? Or if it's not the was git is supposed to
> be used, is there a way to hide the diff (even from git-log) or something ?

Yes. But you'll change the whole history (of course, it should _never_ mention the file). See git filter-branch (there is even an example at the end of its man page. Replace mv with rm)

Previous: marcreddist@aim.comNext: Stefan Karpinski
Message 2 of 6 in “Really remove a file ?”
  1. marcreddist@aim.comOct 9, 2008
  2. Alex RiesenOct 9, 2008
  3. Stefan KarpinskiOct 9, 2008
  4. marcreddist@aim.comOct 10, 2008
  5. Björn SteinbrinkOct 10, 2008
  6. Stefan KarpinskiOct 10, 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.