Hi, On 11/12/07, Karel Zak <kzak@xxxxxxxxxx> wrote: > On Thu, Nov 01, 2007 at 02:38:24AM +0100, Rene Herman wrote: > A) Edit non-HEAD patch (e.g 5th patch from the top): > > git checkout -b tmp HEAD~5 > git reset HEAD^ > $EDIT file.c > git commit -a -c ORIG_HEAD > git rebase --onto tmp master~5 master > git branch -D tmp > > (you can try to write a script if you need it really often) > > B) Remove non-HEAD patch: > > git checkout -f -b tmp badcommit^ > git rebase --onto badcommit yourbranch > git branch -d tmp > > > --- my git-rmcommit script ---- > > #!/bin/bash > > CID="$1" > > if [ -z "$CID" ]; then > echo "Usage: $0 <commit>" > exit 1 > fi > > MYBRANCH=$(git branch | gawk '/^\* / { print $2 }') > TMPBRANCH="tmp.$$" > > echo "Removing commit $CID from $MYBRANCH..." > echo > > git checkout -f -b "$TMPBRANCH" "$CID"^ > git rebase --onto "$TMPBRANCH" "$CID" "$MYBRANCH" > git branch -d "$TMPBRANCH" > > echo "done." Hmm, thanks ! I will check it out ! naziir -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ