git-kill: rewrite history removing a commit

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Junio C Hamano <junkio@...>
Cc: <git@...>
Date: Wednesday, January 31, 2007 - 3:55 pm

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
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
git-kill: rewrite history removing a commit, Michael S. Tsirkin, (Wed Jan 31, 3:55 pm)
Re: git-kill: rewrite history removing a commit, Junio C Hamano, (Wed Jan 31, 4:26 pm)
Re: git-kill: rewrite history removing a commit, Michael S. Tsirkin, (Wed Jan 31, 4:54 pm)
Re: git-kill: rewrite history removing a commit, Yann Dirson, (Wed Jan 31, 4:22 pm)
Re: git-kill: rewrite history removing a commit, Catalin Marinas, (Thu Feb 1, 8:41 am)