6

I want to change the commit message of a commit which I did earlier and pushed to origin/master. now I have done a couple of commits and push(s) after that. Is there any way to change the commit message of second last or third last push that was made to master?

Umair Aslam
  • 377
  • 4
  • 10
  • [Rebase](http://git-scm.com/book/en/Git-Branching-Rebasing). Is this a shared repo? If so, others won't be happy. – beatgammit Mar 20 '13 at 08:22
  • 4
    http://stackoverflow.com/questions/179123/how-do-i-edit-an-incorrect-commit-message-in-git Second or third answer. – Eric Smekens Mar 20 '13 at 08:23
  • The third answer is the one you want: http://stackoverflow.com/questions/179123/how-do-i-edit-an-incorrect-commit-message-in-git/180085#180085 - and remember to read the comments discussing what to do if you've already pushed the commit upstream. – sonicwave Mar 20 '13 at 09:58
  • 1
    No, you cannot change commits you pushed and changing a commit message counts as changing the commit. – wRAR Mar 26 '13 at 18:11

0 Answers0