You can just add --no-edit
to use the last message. This option existed since 2005 but only recently has been enabled for the --amend
option.
The other way is to add -C HEAD
to the commit command with amend option. This allows you to not just use the current commit's message but you can specify any other reference you like, so it's worth remembering it.
This is particularly useful when constructing a commit from various places in history and using one of those commit's messages. For example:
git checkout feature1^^ -- database/table1.sql
git checkout feature1^^^^ -- logger.py
git add -A && git commit -C feature1
which would just use 2 commits from a feature1 and use the commit message from the last commit to feature1 - if that was a good description.