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!
![How to Create a RetroPie on Raspberry Pi – Graphical Guide]()
Today we get to play amazing games on our super powered game consoles, PCs, VR headsets, and even mobile devices. While I enjoy playing new games these days, I do long for the retro gaming systems I had when I was a kid: the original Nintendo...
![Create a CSS Flipping Animation]()
CSS animations are a lot of fun; the beauty of them is that through many simple properties, you can create anything from an elegant fade in to a WTF-Pixar-would-be-proud effect. One CSS effect somewhere in between is the CSS flip effect, whereby there's...
![Animated AJAX Record Deletion Using Dojo]()
I'm a huge fan of WordPress' method of individual article deletion. You click the delete link, the menu item animates red, and the item disappears. Here's how to achieve that functionality with Dojo JavaScript.
The PHP - Content & Header
The following snippet goes at the...
![Multiple File Upload Input]()
More often than not, I find myself wanting to upload more than one file at a time. Having to use multiple "file" INPUT elements is annoying, slow, and inefficient. And if I hate them, I can't imagine how annoyed my users would be. Luckily Safari, Chrome...
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.