public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
* git-kill: rewrite history removing a commit
@ 2007-01-31 19:55 Michael S. Tsirkin
  2007-01-31 20:22 ` Yann Dirson
  2007-01-31 20:26 ` Junio C Hamano
  0 siblings, 2 replies; 5+ messages in thread
From: Michael S. Tsirkin @ 2007-01-31 19:55 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

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.

#!/bin/sh

commit=$1;
#git-rev-list $commit.. 
revlist=`git-rev-list $commit.. | tac`
git reset --hard $commit
git reset --hard HEAD~1
for rev in $revlist
do
	git-cherry-pick $rev
done
-- 
MST

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-02-01 12:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-31 19:55 git-kill: rewrite history removing a commit Michael S. Tsirkin
2007-01-31 20:22 ` Yann Dirson
2007-02-01 12:41   ` Catalin Marinas
2007-01-31 20:26 ` Junio C Hamano
2007-01-31 20:54   ` Michael S. Tsirkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox