Paul's Programming Notes     Archive     Feed     Github

git commit --amend -C HEAD

Ever committed something and needed to make changes later? Just rebase and squash it, right? Or maybe "git reset --soft HEAD~1" and commit again?

There's an even better solution: "git commit --amend -C HEAD"

It will add the combine your commit with your last commit. If you already pushed, you will need to force push your change.