How to Change Last Commit Message in Git

undefined

We can update last commit log using --amend option in git commit. Use the following command to do it but remember that if some other has already sync your changes then they again need to sync your code to avoid any future problems related to this.

$ git commit --amend -m "Your updated commit message"

This will change last commit message in your local repository. But if you have already pushed your changes to remote branches, Then you also need to push your changes again to remote server forcefully.

For example you need to push changes in master branch of remote origin.

$ git push origin master --force

If You Appreciate What We Do Here On Mimastech, You Should Consider:

  1. Stay Connected to: Facebook | Twitter | Google+
  2. Support us via PayPal Donation
  3. Subscribe to our email newsletters.
  4. Tell other sysadmins / friends about Us - Share and Like our posts and services

We are thankful for your never ending support.

One Comment to How to Change Last Commit Message in Git

  1. […] in your current working repository. If you just want to change last commit message, you can use this article to do […]

Leave a Reply

Your email address will not be published. Required fields are marked *