Modify Commit Message

Is there a way to modify the commit message for the current commit using SourceTree? Currently, I have to go to the command-line and run the following:

git commit --amend -m "New Message"

2 answers

1 accepted

Yeah, you can do this: there's a checkbox at the bottom left of the Commit dialog which says 'Amend latest commit', when you check it the previous message will appear in the box and you can edit it, then hit Commit to modify it. You can even change the contents of the commit if you want (file changes). Obviously make sure you haven't pushed your changes before using this :)

Ah, thanks Steve :) That's exactly what I was looking for. I thought I remembered that being there somewhere but just couldn't find it when I searched ...

IIRC, this command has the disadvantage to also commit staged files. If you want to only edit the last commit message without touching the index or working tree, it will be a little bit more complicated.

You say it will be a "little bit more complicated" but you don't actually mention if it's possible to do so with SourceTree :) And if it is possible, how to do it ...

If you want to change the last commit's message without touching the index or working tree, you need to create a temp file, amend-commit this addition, remove the file and amend-commit this removal with the new message.

Suggest an answer

Log in or Join to answer
Community showcase
Brian Ganninger
Published Jan 23, 2018 in Sourcetree

Tip from the team: workflow and keyboard shortcuts

Supported Platforms macOS Sourcetree has a lot to offer and, like many developer tools, finding and using it all can be a challenge, especially for a new user. Everyone might not love ...

269 views 0 3
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot