Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Update historical commit message in SourceTree

Tags:

git

sourcetree

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?

like image 563
Tyler Murry Avatar asked Jan 23 '26 18:01

Tyler Murry


1 Answers

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.

like image 147
Mischa Avatar answered Jan 26 '26 10:01

Mischa



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!