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

Re: git-kill: rewrite history removing a commit

From
Junio C Hamano <junkio@cox.net>
Date
Jan 31, 2007, 20:26 UTC
Message-ID
<7v7iv3uelv.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20070131195533.GE21097@mellanox.co.il>
"Michael S. Tsirkin" <mst@mellanox.co.il> writes:
Show 7 quoted lines
> Below is a simple script that rewrites history reverting a single commit.
> This differs from git-revert in that a commit is completely removed,
> and is especially useful before one has published a series of
> commits.
>
> Do you find this useful? Comments?
> Drop me a line.
"Do you find this useful" is a loaded question.

I do it all the time with git-rebase, so the need to remove a botched commit from the history and rebuild the remainder is certainly there, meaning "what your patch does IS useful".

I do it all the time with git-rebase, so I personally do not need a new tool to do this, meaning "your patch is not useful to me".

When I find master~8 and master~9 to be undesirable, I would do:
	$ git rebase --onto master~10 master~8

which rebuilds master~7 and onward on top of master~10, thereby dropping two commits.

Previous: Catalin MarinasNext: Michael S. Tsirkin
Message 4 of 5 in “git-kill: rewrite history removing a commit”
  1. Michael S. TsirkinJan 31, 2007
  2. Yann DirsonJan 31, 2007
  3. Catalin MarinasFeb 1, 2007
  4. Junio C HamanoJan 31, 2007
  5. Michael S. TsirkinJan 31, 2007

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.