2

Possible Duplicate:
How do I edit an incorrect commit message in Git?

I am trying to edit the commit message for a previous commit.

this the git log output:

commit B
Author my name
date   2
message 2

commit A
Author my name
date   1
message 1

How to edit the message1?

Community
  • 1
  • 1
user1772643
  • 615
  • 3
  • 11
  • 23

1 Answers1

0

git rebase -i HEAD^^ should give you option to change two last commits, then you can choose to amend commit A and change its log message. Note that this will change hash of both commit A and commit B, so if anyone has already pulled your changes, they will get weird conflicts.

che
  • 12,097
  • 7
  • 42
  • 71
  • 1
    It's probably worth pointing out that the `r` or `reword` action in `git rebase -i` is the easiest one if you just need to change the commit message. – Mark Longair Nov 05 '12 at 17:31