I a have a small problem with Git commit. So I am working on some project and using Git. I did a Git commit and I accidentally wrote a wrong commit message. So my question is:
Is there anyway I can change the commit message in Git?
NOTE: I have tried to do this way:
git commit -a --amend -m "New Commit Message"
But it doesn't work. Why?
Thanks.
Lose the first -a
you aren't adding any files, you're just changing the HEAD commit:
git commit --amend -m"New Commit Message"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With