Git Update Commit Message
One of my faults as a professional developer is that my commit messages aren't always as descriptive as they could be. Sometimes I even notice a spelling error in them. Bleh -- that's not cool, man. When I do catch that my last commit message isn't good enough, I find the following git command useful:
The command below rewrites the message for the previous commit. You can omit the -m
and message to go into the commit shell instead.
git commit --amend -m "This is the new message"
Do realize, however, that performing this after you've pushed to a remote repo is considered bad as it rewrites history. If you haven't pushed, however, the command above is gold!
![I’m an Impostor]()
This is the hardest thing I've ever had to write, much less admit to myself. I've written resignation letters from jobs I've loved, I've ended relationships, I've failed at a host of tasks, and let myself down in my life. All of those feelings were very...
![6 Things You Didn’t Know About Firefox OS]()
Firefox OS is all over the tech news and for good reason: Mozilla's finally given web developers the platform that they need to create apps the way they've been creating them for years -- with CSS, HTML, and JavaScript. Firefox OS has been rapidly improving...
![WebSocket and Socket.IO]()
My favorite web technology is quickly becoming the WebSocket API. WebSocket provides a welcomed alternative to the AJAX technologies we've been making use of over the past few years. This new API provides a method to push messages from client to server efficiently...
![AJAX Username Availability Checker Using MooTools]()
This is one of the things I do more frequently :-/
The good thing is that, with amend, you can also include in the commit new changes (provided that you have added them to the staging area).
The drawback is that it’s **bad** to amend a commit that has already been pushed to a remote repository.
May I point you to an article of my own, in which I describe some more solutions on how to change commit messages:
http://www.gamez.name/change-commit-message-git/
Be careful, this command rewrites history and shouldn’t be used if you already pushed your last commit.
And you are noticing it now? :D
One thing to remember is HASH is changed on amending.
And you are noticing it now? :D
Well, one thing to notice is that HASH of that particular commit is rewritten when amending.