Skip to content

Quickly amend a git commit

Sébastien Dubois / April 20, 2020

1 min read

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!

PS: check out the Dev Concepts collection of e-books, join the Software Crafters community, the Personal Knowledge Management community, and come say hi on Twitter!
Discuss on TwitterEdit on GitHub