3

I have several commits in my history that I would like to update the wording on. I have not pushed these changes to my remote repo.

I have only been able to find a way to reset the last commit message. Is there a way to do it for other commits than the most recent?

Tyler Murry
  • 2,705
  • 3
  • 29
  • 46

1 Answers1

2

You can use the rebase feature to achieve your goal of rewording commit messages for one or more commits in the history.

The application SourceTree is able to perform an interactive rebase. In SourceTree's interactive rebase screen, you can simply double-click on the message column in order to change one or more commit messages.

On the command line, this is most easily done using git rebase -i <commit-id>. (Actually, you can do much more interesting stuff with Git's rebase command.) Just do the rebase with a <commit id> that is older than the one in question and replace the command pick with reword (and the old message with the new message) for all those commits the commit message of which you want to update.

Pang
  • 9,564
  • 146
  • 81
  • 122
Mischa
  • 623
  • 5
  • 17