Today we’ll show you how to change unpushed commit message in Git. This is a small article but very useful for those who work with Git.
Let’s assume that you have committed the code but it’s not pushed yet. In this type of case, you can change the most recent commit message by running the command below.
git commit --amend
After executing the command, Editor will be auto open where you can change the commit message then save and close it.
You can also change the commit message directly in the command line.
git commit --amend -m "Write your new commit message"
That’s it for today.
Thank you for reading. Happy Coding..!!