I want to edit previous commit messages, not just the last one. Can I do this using the rebase dialog in Intellij?
If the commit only exists in your local repository and has not been pushed to GitHub.com, you can amend the commit message with the git commit --amend command. On the command line, navigate to the repository that contains the commit you want to amend. Type git commit --amend and press Enter.
When you add a new git commit in VS Code you can press Arrow Up in the commit message input to get the previous commit message. Press it several times to get older commit messages. Note: this only works for changes committed with the source control panel in VS Code.
I worked out how to do it but it seems long winded. Choose interactive rebase onto master, then 'edit' on the commit whose message you want to edit.
This is where you should be able to amend a commit in the commit dialog, but you can't because there's nothing to commit.
So you have to go to the command line and do git commit --amend
, then git rebase --continue
.
Update: You can use 'reword' instead, see comments below.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With