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

Re: How to remove a commit object?

From
Jakub Narebski <jnareb@gmail.com>
Date
Oct 2, 2008, 14:02 UTC
Message-ID
<m3ljx7qemk.fsf@localhost.localdomain>
In-Reply-To
<33f4f4d70810020636g77f4180cm7aa6b7de07ae5beb@mail.gmail.com>
"Klas Lindberg" <klas.lindberg@gmail.com> writes:
Show 6 quoted lines
> This doesn't seem to work for me. I will soon be in a situation where
> I need to selectively delete commits in such a way that they become
> completely irrecoverable. I.e. it is not enough to revert a commit.
> The *original* commit must be removed. And of course, the repo history
> is too complex to allow for rebasing followed by garbage collection or
> something like that.
[...]
> Would it be feasible to write a tool that can selectively replace a
> specific commit in the commit DAG, or would that automatically
> invalidate every SHA key for every commit that follows the replaced
> original?

It would invalidate SHA1 for every commit after first rewritten. There are two tools which you can use to rewrite large parts of history automatically: git-filter-branch, and git-fast-export + git-fast-import.

HTH
-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: Michael J GruberNext: Klas Lindberg
Message 5 of 11 in “How to remove a commit object?”
  1. Steven GrimmSep 18, 2008
  2. Michael J GruberSep 19, 2008
  3. Klas LindbergOct 2, 2008
  4. Michael J GruberOct 2, 2008
  5. Jakub NarebskiOct 2, 2008
  6. Klas LindbergOct 2, 2008
  7. Michael J GruberOct 2, 2008
  8. Klas LindbergOct 2, 2008
  9. Johannes SixtOct 2, 2008
  10. Klas LindbergOct 3, 2008
  11. Johannes SixtOct 3, 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.