How to Change Last Commit Message in Git
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:
- Stay Connected to: Facebook | Twitter | Google+
- Support us via PayPal Donation
- Subscribe to our email newsletters.
- Tell other sysadmins / friends about Us - Share and Like our posts and services
We are thankful for your never ending support.
[…] in your current working repository. If you just want to change last commit message, you can use this article to do […]