Quickly amend a git commit by skipping edit

Here is the quickest way to amend a git commit

Quickly amend a git commit by skipping edit

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! ✨

About Sébastien

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 subscribe to my newsletter, check out my 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 one of my communities: the Software Crafters community, the Personal Knowledge Management community, and the focusd Productivity community