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 Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 30, 2018 in Sourcetree

Tip from the team: configuring Git or Mercurial in Sourcetree

Supported Platforms macOS Windows To make using Sourcetree as simple yet powerful as possible we embed (bundle) dependencies such as Git, Git LFS, and Mercurial. We strive to keep these...

570 views 1 2
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