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!
![5 Awesome New Mozilla Technologies You’ve Never Heard Of]()
My trip to Mozilla Summit 2013 was incredible. I've spent so much time focusing on my project that I had lost sight of all of the great work Mozillians were putting out. MozSummit provided the perfect reminder of how brilliant my colleagues are and how much...
![Create Spinning Rays with CSS3: Revisited]()
![CSS Sprites]()
The idea of CSS sprites is pretty genius. For those of you who don't know the idea of a sprite, a sprite is basically multiple graphics compiled into one image. The advantages of using sprites are:
Fewer images for the browser to download, which means...
![CSS Filters]()
CSS filter support recently landed within WebKit nightlies. CSS filters provide a method for modifying the rendering of a basic DOM element, image, or video. CSS filters allow for blurring, warping, and modifying the color intensity of elements. Let's have...
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.