1

Is there a way to change an old commit message without force push?

I made a typo and pushed to the master branch. Now the problem is I made a typo in the commit message. Is there a way just to edit the message without force push?

I am happy with the commit message context, I just need to update the commit message?

Is it possible?

Exploring
  • 2,493
  • 11
  • 56
  • 97
  • @KenY-N not it does not, it uses force push – Exploring Sep 03 '20 at 02:17
  • https://stackoverflow.com/search?q=%5Bgit%5D+amend+without+force+push, https://stackoverflow.com/search?q=%5Bgit%5D+rebase+without+force+push – phd Sep 03 '20 at 08:45

2 Answers2

1

No. Changing the commit message would change the commit identifier. So, it would technically be a different commit. So force push would be required. DON'T FORCE PUSH TO MASTER. You'll just have to live with the typo.

Jamie Bisotti
  • 2,605
  • 19
  • 23
0

Editing the commit message results in a new commit. But git-notes allows to add additional remarks without changing the commit itself.

Here is a good question and answer about git notes.

ElpieKay
  • 27,194
  • 6
  • 32
  • 53