Amending the most recent git commit message.
Amending the most recent git commit message.
# Will open your editor, allowing to change the commit message of the most recent commit.
git commit --amend
Amending the most recent git commit message (direct).
git commit --amend -m "New commit message"
Changing the message of a commit that already being pushed to a remote branch.
git push <remote> <branch> --force
# Or
git push <remote> <branch> -f
Use interactive rebase.
# N is the number of commits to the last commit you want to be able to edit
git rebase -i HEAD~N