Scott Whittaker

Frontend Developer

Day job React | side projects Svelte

Git Amend

Some amend snippets that are worth remembering. See the documentation for all the commit joy.

Amend last local commit message

git commit --amend -m  'amended commit message'

You can also do the following which will open an editor allowing you to modify the message.

git commit --amend

Amend with --no-edit

This allows you to amend the last commit with any changes you have made without changing the commit message.

git commit --amend --no-edit

–no-edit Use the selected commit message without launching an editor. For example, git commit –amend –no-edit amends a commit without changing its commit message.

git-commit Documentation