Change the message of the last commit
git change last commit message | fix typo in commit message | add forgotten file to last commit | git | commit | fixCaution: This command changes the system. Understand what it does before you run it.
git commit --amend -m 'Fix: correct cache path in configuration'Replaces the last commit with a new one using the given message. Anything staged beforehand with git add goes into the commit as well, so forgotten files can be added. With --no-edit instead of -m, the old message is kept.
Note: The commit gets a new hash. If it was already pushed, a git push --force-with-lease is required afterwards, which disrupts other users of the branch.
Also searched as
- git change last commit message
- fix typo in commit message
- add forgotten file to last commit