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: https://jira.atlassian.com/browse/SRCTREE-697

Question was actually about restoring the previous commit message when the amend commit option is checked. This is being tracked here: https://jira.atlassian.com/browse/SRCTREE-697

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...

416 views 0 1
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