On Thu, Jul 17, 2008 at 02:49:04PM -0400, Len Brown wrote:
Linus's answer (with rebase -i) is probably better, but my habit is to
do what you describe, with some minor shortcuts:
Instead of the above three steps, you can do just:
$ edit
$ git commit -a --amend
At this point I do
git rebase --onto HEAD old-sha1 name-of-branch-to-rebase
(where old-sha1 is the name of the commit we just replaced, which I
usually cut-n-paste out of gitk). That rebases the commits in the range
old-sha1...name-of-branch-to-rebase onto the new HEAD commit that you
just created, and replaces the named branch with the result.
That works too.
--b.
--