previous commit message is not added automatically when amending

When I click "amend latest commit" it doesn't seem to add the last commit message (post commit-msg hook) to the commit message text box for me. In my case we use gerrit and there is a unique Change-Id generated in the commit-msg hook that needs to be sent withi any amended changes.

using the command line tools "git commit --amend" does this, as do other GUI clients I have used.

2 answers

I don't think this would be desired behaviour for most people anyway; when you amend a commit, you want control over what's in the commit message. If your tools like to see change ids, you can add them - but really I don't think amending commits that have already been pushed elsewhere is a good idea anyway.

I should make my question more generic - when I click amend it doesn't put my last commit message into the commit message text box for me. This would automatically include any change-Id tacked on from my commit-msg hook. It seems like I only have the ability to pick an old message that I had typed in (before the hook added its change-id)

Ah I see - sorry I thought you meant adding the previous commit SHA.

This issue is being tracked here:

Question was actually about restoring the previous commit message when the amend commit option is checked. This is being tracked here:

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Oct 23, 2018 in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

964 views 4 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