Change Last Commit Message
Usage
For Local Commits
git commit --amend -m "{NEW_MESSAGE}For Already Pushed Commits
git commit --amend -m "{NEW_MESSAGE}"
git push --forceLast updated
We can use git commit --amend command to change the most recent commit message.
git commit --amend -m "{NEW_MESSAGE}In this case, we can only edit the most recent commit message and force push it to remote -
git commit --amend -m "{NEW_MESSAGE}"
git push --forceNote: Force Pushes can break things, so warnings ahead!
Source: Linuxize
Last updated