Sitemap

Member-only story

Quickly amend a git commit

1 min readApr 20, 2020

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!

--

--

Sébastien Dubois
Sébastien Dubois

Written by Sébastien Dubois

Leading the movement to transform mental chaos into clarity, helping knowledge workers break free from information overload. 💌 https://dsebastien.net

No responses yet