Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Isn’t `git commit --amend` enough? No need to reset and commit again.


Sometimes it's easier to undo & redo. That's the reset approach. (Reset, your mistake goes away, do it over again but right, then commit.)

Sometimes it's easier to just make another change. That's the amend approach. (Keep what you've got, which was almost right, make another change--add, delete, or edit--so it's right, and re-commit as if you'd made that additional change from the start.)


Maybe if you only need to add something, but not if you included something you didn't want to in the commit, but you still want to leave the change there.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: