On Sep 25, 8:15 am, "davidshe...@googlemail.com"
<davidshe...@googlemail.com> wrote:
> hi,
> i found i made a typo error in a commit message which is many commits
> away from current HEAD, how can i amend the message? i tried git
> commit --commit <my commit hash>, but it created an new commit and
> advanced my HEAD.

May not be the best, but you can try this:

* After switching to your brach, do "git rebase -i <your commit>"
* In the edited, change "pick <your commit>" to "edit <your commit>,
and close the editor
* The rebase operation will pause for you. At that point it's in a
state where you made <your commit>
* You can now do a "git commit --amend", edit your commit message and
perform the commit as usual
* Once you're done, you can finish the rebase with "git rebase --

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to