Read more

Change commit messages of past Git commits

Tobias Kraze
November 23, 2010Software engineer at makandra GmbH

To change a commit message of the most recent (unpushed) commit, you can simply use
git commit --amend -m 'new message'

Illustration online protection

Rails Long Term Support

Rails LTS provides security patches for old versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2)

  • Prevents you from data breaches and liability risks
  • Upgrade at your own pace
  • Works with modern Rubies
Read more Show archive.org snapshot

To change messages of (unpushed) commits further in the past:

git rebase -i [COMMIT BEFORE THE FIRST YOU WANT TO EDIT]

Mark all messages to be changed with "edit".

Git will start the rebasing and stop at every marked commit. For each of those, do a
git commit --amend -m 'new message'
git rebase --continue

Posted by Tobias Kraze to makandra dev (2010-11-23 15:51)