Quickly amend a git commit by skipping edit
Here is the quickest way to amend a git commit
Here’s a useful thing I’ve learned today: you can skip editing the commit text when you amend a commit with git:
git commit --amend --no-edit
I wish I knew this earlier! ;-)
As an added bonus, you can also define an alias for this in your bash profile (only if you’re lazy like me):
alias amend='git commit --amend --no-edit'
If you like living “dangerously”, you can even put a git add -A in there, but personally I prefer not to.
That's it for today! ✨
Hello everyone! I'm Sébastien Dubois. I'm an author, founder, and CTO. I write books and articles about software development & IT, personal knowledge management, personal organization, and productivity. I also craft lovely digital products 🚀
If you've enjoyed this article and want to read more like this, then become a subscriber, check out my Obsidian Starter Kit, the PKM Library and my collection of books about software development 🔥.
You can follow me on Twitter 🐦
If you want to discuss, then don't hesitate to join the Personal Knowledge Management community or the Software Crafters community.