Languages
[Edit]
EN

Git change commit message

5 points
Created by:
Paris-Bateman
504

In order to change message of last commit:

git commit --amend

then git will open editor and allow us to change commit message. If we use vi / vim as editor to exit we use :wq (write and quit).

To see if we changed our commit message use git log command.

Change message of commit that we already pushed to remote repository

If we already pushed branch to remote repository then we need to use git push with force to override the changes on remote repository.

git push origin FEATURE_BRANCH -f

Where:

  • -f is shortcut from --force

Alternative titles

  1. Git - edit last commit message (before push)
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

Git

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join