Git commit --amend sorcery

Git amend can add stuff to a previous commit. It's quite handy if you, for example, fix some url's in a test file, commit and then notice you had similar stuff that should've been in the same commit.

Kalle Tolonen
8.7.2025

To add more stuff to a previous commit you only need to amend it:

git commit --amend

Keep or modify the commit msg and you're all set! This is completely safe if you haven't pushed the commit to remote.


Comments

No published comments yet.


Add a Comment

Your comment is held for review before it appears publicly.

Tick the box, then click Submit right away (Google expires the check after about two minutes).