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.

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.

All articles


Comments

No published comments yet.


Add a Comment

Your comment is held for review before it appears publicly.

Your email is never published or shared.

Up to 2,000 characters.

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